summaryrefslogtreecommitdiffstats
path: root/src/common/io_exerciser/RadosIo.h
diff options
context:
space:
mode:
authorJonBailey1993 <jonathan.bailey1@ibm.com>2024-10-01 12:25:48 +0200
committerJon Bailey <jonathan.bailey1@ibm.com>2025-01-07 12:40:32 +0100
commit4f3ef50fd8a0884e22c8ab717b4357cab9723ad8 (patch)
treed5422e8ba02856624ace7a996bd57ae22b5cdce9 /src/common/io_exerciser/RadosIo.h
parentMerge pull request #61240 from neesingh-rh/wip-68974 (diff)
downloadceph-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.h23
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);
};
}