From: Alex Ainscow Date: Fri, 3 Oct 2025 14:34:55 +0000 (+0100) Subject: osdc: Interface to allow split reads to copy op from client op to split op X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6a24afdfdba9d86accf8065871c3f1649d9fb1af;p=ceph.git osdc: Interface to allow split reads to copy op from client op to split op 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 --- diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 06a3224e79f2..fffcb9cb71d7 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -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");