diff options
author | JonBailey1993 <jonathan.bailey1@ibm.com> | 2024-10-01 12:25:48 +0200 |
---|---|---|
committer | Jon Bailey <jonathan.bailey1@ibm.com> | 2025-01-07 12:40:32 +0100 |
commit | 4f3ef50fd8a0884e22c8ab717b4357cab9723ad8 (patch) | |
tree | d5422e8ba02856624ace7a996bd57ae22b5cdce9 /src/common/io_exerciser/RadosIo.h | |
parent | Merge pull request #61240 from neesingh-rh/wip-68974 (diff) | |
download | ceph-4f3ef50fd8a0884e22c8ab717b4357cab9723ad8.tar.xz ceph-4f3ef50fd8a0884e22c8ab717b4357cab9723ad8.zip |
src/common/io_exerciser: Code readability improvements
Implement inheritence for ceph::io_exerciser::IoOp to allow better differentiation between the different Op types and allow more complex Operations to be implemented
Signed-off-by: Jon Bailey <jonathan.bailey1@ibm.com>
Diffstat (limited to 'src/common/io_exerciser/RadosIo.h')
-rw-r--r-- | src/common/io_exerciser/RadosIo.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/common/io_exerciser/RadosIo.h b/src/common/io_exerciser/RadosIo.h index 179c5bba3ae..eba80a24368 100644 --- a/src/common/io_exerciser/RadosIo.h +++ b/src/common/io_exerciser/RadosIo.h @@ -18,7 +18,7 @@ namespace ceph { namespace data_generation { class DataGenerator; } - + class RadosIo: public Model { protected: librados::Rados& rados; @@ -35,7 +35,7 @@ namespace ceph { void start_io(); void finish_io(); void wait_for_io(int count); - + public: RadosIo(librados::Rados& rados, boost::asio::io_context& asio, @@ -51,29 +51,22 @@ namespace ceph { void allow_ec_overwrites(bool allow); + template <int N> class AsyncOpInfo { public: librados::ObjectReadOperation rop; librados::ObjectWriteOperation wop; - ceph::buffer::list bl1; - ceph::buffer::list bl2; - ceph::buffer::list bl3; - uint64_t offset1; - uint64_t length1; - uint64_t offset2; - uint64_t length2; - uint64_t offset3; - uint64_t length3; + std::array<ceph::bufferlist, N> bufferlist; + std::array<uint64_t, N> offset; + std::array<uint64_t, N> length; - AsyncOpInfo(uint64_t offset1 = 0, uint64_t length1 = 0, - uint64_t offset2 = 0, uint64_t length2 = 0, - uint64_t offset3 = 0, uint64_t length3 = 0 ); + AsyncOpInfo(const std::array<uint64_t, N>& offset = {}, + const std::array<uint64_t, N>& length = {}); ~AsyncOpInfo() = default; }; // Must be called with lock held bool readyForIoOp(IoOp& op); - void applyIoOp(IoOp& op); }; } |