From 6a24afdfdba9d86accf8065871c3f1649d9fb1af Mon Sep 17 00:00:00 2001 From: Alex Ainscow Date: Fri, 3 Oct 2025 15:34:55 +0100 Subject: [PATCH] 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 --- src/osdc/Objecter.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 06a3224e79f..fffcb9cb71d 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"); -- 2.47.3