]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc: Interface to allow split reads to copy op from client op to split op
authorAlex Ainscow <aainscow@uk.ibm.com>
Fri, 3 Oct 2025 14:34:55 +0000 (15:34 +0100)
committerAlex Ainscow <aainscow@uk.ibm.com>
Wed, 26 Nov 2025 11:28:25 +0000 (11:28 +0000)
When spliting ops, certain addition sub ops (e.g. get xattr) can be simply passed
through to the child op.

Signed-off-by: Alex Ainscow <aainscow@uk.ibm.com>
src/osdc/Objecter.h

index 06a3224e79f2f26c1dfd55096d679447a8c123cc..fffcb9cb71d7f2c10c5207296e9c7ebc6de1cc11 100644 (file)
@@ -161,6 +161,11 @@ struct ObjectOperation {
 
   }
 
+  OSDOp& pass_thru_op(OSDOp& op) {
+    ops.emplace_back(op);
+    return ops.back();
+  }
+
   OSDOp& add_op(int op) {
     ops.emplace_back();
     ops.back().op.op = op;
@@ -2120,6 +2125,26 @@ public:
       return tid < other.tid;
     }
 
+    void pass_thru_op(::ObjectOperation &other, unsigned index, bufferlist *bl, int *rval) {
+      ceph_assert(index < ops.size());
+
+      other.pass_thru_op(ops[index]);
+      unsigned p = other.ops.size() - 1;
+      ceph_assert(out_bl.size() == ops.size());
+      ceph_assert(out_rval.size() == ops.size());
+      ceph_assert(out_ec.size() == ops.size());
+      ceph_assert(out_handler.size() == ops.size());
+
+      other.out_bl.resize(p + 1);
+      other.out_rval.resize(p + 1);
+      other.out_ec.resize(p + 1);
+      other.out_handler.resize(p + 1);
+
+      other.out_bl[p] = bl;
+      other.out_rval[p] = rval;
+      // We don't copy the out handler here - it must be run by the copied-from op.
+    }
+
   private:
     ~Op() override {
       trace.event("finish");