From 0d6aa23c0277bec6f852f71e060f6b74b719742a Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Fri, 12 Jul 2019 17:48:02 -0400 Subject: [PATCH] osdc: Use boost::container::small_vector for ops vector This way making an ObjectOperation won't require allocations just for a few ops. Signed-off-by: Adam C. Emerson --- src/crimson/osd/osd.h | 2 +- .../osd/osd_operations/background_recovery.h | 2 +- .../osd/osd_operations/client_request.h | 3 +- src/crimson/osd/pg.h | 2 + src/crimson/osd/pg_backend.h | 4 +- src/messages/MOSDOp.h | 11 +- src/msg/MessageRef.h | 2 - src/osd/OSD.h | 1 - src/osd/PG.h | 1 - src/osd/PrimaryLogPG.h | 2 - src/osd/osd_op_util.h | 3 +- src/osd/osd_types.cc | 47 -------- src/osd/osd_types.h | 49 +++++++- src/osdc/Filer.cc | 4 +- src/osdc/Objecter.cc | 12 +- src/osdc/Objecter.h | 105 +++++++++++------- 16 files changed, 132 insertions(+), 118 deletions(-) diff --git a/src/crimson/osd/osd.h b/src/crimson/osd/osd.h index d0f7c2230bd..47e8280368a 100644 --- a/src/crimson/osd/osd.h +++ b/src/crimson/osd/osd.h @@ -26,6 +26,7 @@ #include "crimson/osd/pg_map.h" #include "crimson/osd/osd_operations/peering_event.h" +#include "messages/MOSDOp.h" #include "osd/PeeringState.h" #include "osd/osd_types.h" #include "osd/osd_perf_counters.h" @@ -33,7 +34,6 @@ class MCommand; class MOSDMap; -class MOSDOp; class MOSDRepOpReply; class MOSDRepOp; class OSDMap; diff --git a/src/crimson/osd/osd_operations/background_recovery.h b/src/crimson/osd/osd_operations/background_recovery.h index 73f336fc366..65ea5220c9b 100644 --- a/src/crimson/osd/osd_operations/background_recovery.h +++ b/src/crimson/osd/osd_operations/background_recovery.h @@ -7,7 +7,7 @@ #include "crimson/osd/osd_operation.h" #include "crimson/common/type_helpers.h" -class MOSDOp; +#include "messages/MOSDOp.h" namespace crimson::osd { class PG; diff --git a/src/crimson/osd/osd_operations/client_request.h b/src/crimson/osd/osd_operations/client_request.h index eb81e0c3b94..de0e914d8e6 100644 --- a/src/crimson/osd/osd_operations/client_request.h +++ b/src/crimson/osd/osd_operations/client_request.h @@ -7,8 +7,7 @@ #include "crimson/net/Connection.h" #include "crimson/osd/osd_operation.h" #include "crimson/common/type_helpers.h" - -class MOSDOp; +#include "messages/MOSDOp.h" namespace crimson::osd { class PG; diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index c10139bff76..50905169e24 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -14,6 +14,8 @@ #include "common/dout.h" #include "crimson/net/Fwd.h" +#include "messages/MOSDRepOpReply.h" +#include "messages/MOSDOpReply.h" #include "os/Transaction.h" #include "osd/osd_types.h" #include "crimson/osd/object_context.h" diff --git a/src/crimson/osd/pg_backend.h b/src/crimson/osd/pg_backend.h index 89ca0905869..001e98eb268 100644 --- a/src/crimson/osd/pg_backend.h +++ b/src/crimson/osd/pg_backend.h @@ -14,13 +14,15 @@ #include "crimson/osd/acked_peers.h" #include "crimson/osd/pg.h" #include "crimson/common/shared_lru.h" +#include "messages/MOSDOp.h" +#include "messages/MOSDOpReply.h" +#include "os/Transaction.h" #include "osd/osd_types.h" #include "crimson/osd/object_context.h" #include "crimson/osd/osd_operation.h" #include "crimson/osd/osd_operations/osdop_params.h" struct hobject_t; -class MOSDRepOpReply; namespace ceph::os { class Transaction; diff --git a/src/messages/MOSDOp.h b/src/messages/MOSDOp.h index 43bd4005469..5301f0a43b2 100644 --- a/src/messages/MOSDOp.h +++ b/src/messages/MOSDOp.h @@ -30,8 +30,10 @@ * */ -class OSD; +class MOSDOpReply; +namespace _mosdop { +template class MOSDOp : public MOSDFastDispatchOp { private: static constexpr int HEAD_VERSION = 8; @@ -54,7 +56,7 @@ private: std::atomic final_decode_needed; // public: - std::vector ops; + V ops; private: snapid_t snap_seq; std::vector snaps; @@ -64,7 +66,7 @@ private: osd_reqid_t reqid; // reqid explicitly set by sender public: - friend class MOSDOpReply; + friend MOSDOpReply; ceph_tid_t get_client_tid() { return header.tid; } void set_snapid(const snapid_t& s) { @@ -598,6 +600,9 @@ private: template friend boost::intrusive_ptr ceph::make_message(Args&&... args); }; +} + +using MOSDOp = _mosdop::MOSDOp>; #endif diff --git a/src/msg/MessageRef.h b/src/msg/MessageRef.h index 5eb3655cb84..4f30f0b352a 100644 --- a/src/msg/MessageRef.h +++ b/src/msg/MessageRef.h @@ -133,8 +133,6 @@ class MOSDForceRecovery; class MOSDFull; class MOSDMap; class MOSDMarkMeDown; -class MOSDOp; -class MOSDOpReply; class MOSDPeeringOp; class MOSDPGBackfill; class MOSDPGBackfillRemove; diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 522de0cc846..0aca510e084 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -91,7 +91,6 @@ class TestOpsSocketHook; struct C_FinishSplits; struct C_OpenPGs; class LogChannel; -class MOSDOp; class MOSDPGCreate2; class MOSDPGQuery; diff --git a/src/osd/PG.h b/src/osd/PG.h index cb647574dc4..50a968de78c 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -55,7 +55,6 @@ class OSD; class OSDService; class OSDShard; class OSDShardPGSlot; -class MOSDOp; class MOSDPGScan; class MOSDPGBackfill; class MOSDPGInfo; diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index 57d153727a3..ebc36e81170 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -40,8 +40,6 @@ class PrimaryLogPG; class PGLSFilter; class HitSet; struct TierAgentState; -class MOSDOp; -class MOSDOpReply; class OSDService; void intrusive_ptr_add_ref(PrimaryLogPG *pg); diff --git a/src/osd/osd_op_util.h b/src/osd/osd_op_util.h index 92dac0f5cd3..872dd502c18 100644 --- a/src/osd/osd_op_util.h +++ b/src/osd/osd_op_util.h @@ -8,7 +8,8 @@ #include "osd/OSDMap.h" -class MOSDOp; +#include "messages/MOSDOp.h" + class OpInfo { public: struct ClassInfo { diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 3c235ecc682..557a6b1a06c 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -6776,26 +6776,6 @@ ostream& operator<<(ostream& out, const OSDOp& op) } -void OSDOp::split_osd_op_vector_in_data(vector& ops, ceph::buffer::list& in) -{ - ceph::buffer::list::iterator datap = in.begin(); - for (unsigned i = 0; i < ops.size(); i++) { - if (ops[i].op.payload_len) { - datap.copy(ops[i].op.payload_len, ops[i].indata); - } - } -} - -void OSDOp::merge_osd_op_vector_in_data(vector& ops, ceph::buffer::list& out) -{ - for (unsigned i = 0; i < ops.size(); i++) { - if (ops[i].indata.length()) { - ops[i].op.payload_len = ops[i].indata.length(); - out.append(ops[i].indata); - } - } -} - void OSDOp::split_osd_op_vector_out_data(vector& ops, ceph::buffer::list& in) { auto datap = in.begin(); @@ -6816,33 +6796,6 @@ void OSDOp::merge_osd_op_vector_out_data(vector& ops, ceph::buffer::list& } } -void OSDOp::clear_data(vector& ops) -{ - for (unsigned i = 0; i < ops.size(); i++) { - OSDOp& op = ops[i]; - op.outdata.clear(); - if (ceph_osd_op_type_attr(op.op.op) && - op.op.xattr.name_len && - op.indata.length() >= op.op.xattr.name_len) { - ceph::buffer::list bl; - bl.push_back(ceph::buffer::ptr_node::create(op.op.xattr.name_len)); - bl.begin().copy_in(op.op.xattr.name_len, op.indata); - op.indata.claim(bl); - } else if (ceph_osd_op_type_exec(op.op.op) && - op.op.cls.class_len && - op.indata.length() > - (op.op.cls.class_len + op.op.cls.method_len)) { - __u8 len = op.op.cls.class_len + op.op.cls.method_len; - ceph::buffer::list bl; - bl.push_back(ceph::buffer::ptr_node::create(len)); - bl.begin().copy_in(len, op.indata); - op.indata.claim(bl); - } else { - op.indata.clear(); - } - } -} - int prepare_info_keymap( CephContext* cct, map *km, diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 3169e63c369..630ff3d07aa 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -3960,7 +3960,16 @@ struct OSDOp { * @param ops [out] vector of OSDOps * @param in [in] combined data buffer */ - static void split_osd_op_vector_in_data(std::vector& ops, ceph::buffer::list& in); + template + static void split_osd_op_vector_in_data(V& ops, + ceph::buffer::list& in) { + ceph::buffer::list::iterator datap = in.begin(); + for (unsigned i = 0; i < ops.size(); i++) { + if (ops[i].op.payload_len) { + datap.copy(ops[i].op.payload_len, ops[i].indata); + } + } + } /** * merge indata members of a vector of OSDOp into a single ceph::buffer::list @@ -3971,7 +3980,15 @@ struct OSDOp { * @param ops [in] vector of OSDOps * @param out [out] combined data buffer */ - static void merge_osd_op_vector_in_data(std::vector& ops, ceph::buffer::list& out); + template + static void merge_osd_op_vector_in_data(V& ops, ceph::buffer::list& out) { + for (unsigned i = 0; i < ops.size(); i++) { + if (ops[i].indata.length()) { + ops[i].op.payload_len = ops[i].indata.length(); + out.append(ops[i].indata); + } + } + } /** * split a ceph::buffer::list into constituent outdata members of a vector of OSDOps @@ -3994,11 +4011,35 @@ struct OSDOp { * * @param ops [in] vector of OSDOps */ - static void clear_data(std::vector& ops); + template + static void clear_data(V& ops) { + for (unsigned i = 0; i < ops.size(); i++) { + OSDOp& op = ops[i]; + op.outdata.clear(); + if (ceph_osd_op_type_attr(op.op.op) && + op.op.xattr.name_len && + op.indata.length() >= op.op.xattr.name_len) { + ceph::buffer::list bl; + bl.push_back(ceph::buffer::ptr_node::create(op.op.xattr.name_len)); + bl.begin().copy_in(op.op.xattr.name_len, op.indata); + op.indata.claim(bl); + } else if (ceph_osd_op_type_exec(op.op.op) && + op.op.cls.class_len && + op.indata.length() > + (op.op.cls.class_len + op.op.cls.method_len)) { + __u8 len = op.op.cls.class_len + op.op.cls.method_len; + ceph::buffer::list bl; + bl.push_back(ceph::buffer::ptr_node::create(len)); + bl.begin().copy_in(len, op.indata); + op.indata.claim(bl); + } else { + op.indata.clear(); + } + } + } }; std::ostream& operator<<(std::ostream& out, const OSDOp& op); - struct pg_log_op_return_item_t { int32_t rval; ceph::buffer::list bl; diff --git a/src/osdc/Filer.cc b/src/osdc/Filer.cc index d97e5de0a61..7a64e38ccdb 100644 --- a/src/osdc/Filer.cc +++ b/src/osdc/Filer.cc @@ -415,7 +415,7 @@ void Filer::truncate(inodeno_t ino, if (num_objs == 1) { vector extents; Striper::file_to_extents(cct, ino, layout, offset, len, 0, extents); - vector ops(1); + osdc_opvec ops(1); ops[0].op.op = CEPH_OSD_OP_TRIMTRUNC; ops[0].op.extent.truncate_seq = truncate_seq; ops[0].op.extent.truncate_size = extents[0].offset; @@ -474,7 +474,7 @@ void Filer::_do_truncate_range(TruncRange *tr, int fin) // Issue objecter ops outside tr->lock to avoid lock dependency loop for (const auto& p : extents) { - vector ops(1); + osdc_opvec ops(1); ops[0].op.op = CEPH_OSD_OP_TRIMTRUNC; ops[0].op.extent.truncate_size = p.offset; ops[0].op.extent.truncate_seq = tr->truncate_seq; diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index dc0a6ef09c7..516fe63afd1 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -523,8 +523,8 @@ void Objecter::_send_linger(LingerOp *info, { ceph_assert(sul.owns_lock() && sul.mutex() == &rwlock); - vector opv; fu2::unique_function oncommit; + osdc_opvec opv; std::shared_lock watchl(info->watch_lock); cb::list *poutbl = nullptr; if (info->registered && info->is_watch) { @@ -685,7 +685,7 @@ void Objecter::_send_linger_ping(LingerOp *info) ldout(cct, 10) << __func__ << " " << info->linger_id << " now " << now << dendl; - vector opv(1); + osdc_opvec opv(1); opv[0].op.op = CEPH_OSD_OP_WATCH; opv[0].op.watch.cookie = info->get_cookie(); opv[0].op.watch.op = CEPH_OSD_WATCH_OP_PING; @@ -3085,7 +3085,7 @@ void Objecter::_finish_op(Op *op, int r) op->put(); } -MOSDOp *Objecter::_prepare_osd_op(Op *op) +Objecter::MOSDOp *Objecter::_prepare_osd_op(Op *op) { // rwlock is locked @@ -3212,12 +3212,10 @@ void Objecter::_send_op(Op *op) op->session->con->send_message(m); } -int Objecter::calc_op_budget(const vector& ops) +int Objecter::calc_op_budget(const bc::small_vector_base& ops) { int op_budget = 0; - for (vector::const_iterator i = ops.begin(); - i != ops.end(); - ++i) { + for (auto i = ops.begin(); i != ops.end(); ++i) { if (i->op.op & CEPH_OSD_OP_MODE_WR) { op_budget += i->indata.length(); } else if (ceph_osd_op_mode_read(i->op.op)) { diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index c7d132a5087..a34e02fe018 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -73,18 +74,24 @@ struct EnumerationContext; template struct CB_EnumerateReply; +inline constexpr std::size_t osdc_opvec_len = 2; +using osdc_opvec = boost::container::small_vector; + // ----------------------------------------- struct ObjectOperation { - std::vector ops; + osdc_opvec ops; int flags = 0; int priority = 0; - std::vector out_bl; - std::vector> out_handler; - std::vector out_rval; - std::vector out_ec; + boost::container::small_vector out_bl; + boost::container::small_vector< + fu2::unique_function, + osdc_opvec_len> out_handler; + boost::container::small_vector out_rval; + boost::container::small_vector out_ec; ObjectOperation() = default; ObjectOperation(const ObjectOperation&) = delete; @@ -1562,8 +1569,11 @@ struct ObjectOperation { set_last_op_flags(CEPH_OSD_OP_FLAG_FAILOK); } - void dup(std::vector& sops) { - ops = sops; + template + void dup(V& sops) { + ops.clear(); + std::copy(sops.begin(), sops.end(), + std::back_inserter(ops)); out_bl.resize(sops.size()); out_handler.resize(sops.size()); out_rval.resize(sops.size()); @@ -1604,6 +1614,7 @@ inline std::ostream& operator <<(std::ostream& m, const ObjectOperation& oo) { // ---------------- class Objecter : public md_config_obs_t, public Dispatcher { + using MOSDOp = _mosdop::MOSDOp; public: using OpSignature = void(boost::system::error_code); using OpCompletion = ceph::async::Completion; @@ -1871,18 +1882,21 @@ public: ConnectionRef con = nullptr; // for rx buffer only uint64_t features = CEPH_FEATURES_SUPPORTED_DEFAULT; // explicitly specified op features - std::vector ops; + osdc_opvec ops; snapid_t snapid = CEPH_NOSNAP; SnapContext snapc; ceph::real_time mtime; ceph::buffer::list *outbl = nullptr; - std::vector out_bl; - std::vector> out_handler; - std::vector out_rval; - std::vector out_ec; + boost::container::small_vector out_bl; + boost::container::small_vector< + fu2::unique_function, + osdc_opvec_len> out_handler; + boost::container::small_vector out_rval; + boost::container::small_vector out_ec; int priority = 0; using OpSig = void(boost::system::error_code); @@ -1951,7 +1965,7 @@ public: complete(std::move(onfinish), ec, r); } - Op(const object_t& o, const object_locator_t& ol, vector&& _ops, + Op(const object_t& o, const object_locator_t& ol, osdc_opvec&& _ops, int f, std::unique_ptr&& fin, version_t *ov, int *offset = nullptr, ZTracer::Trace *parent_trace = nullptr) : @@ -1971,7 +1985,8 @@ public: trace.event("start"); } } - Op(const object_t& o, const object_locator_t& ol, vector&& _ops, + + Op(const object_t& o, const object_locator_t& ol, osdc_opvec&& _ops, int f, Context* fin, version_t *ov, int *offset = nullptr, ZTracer::Trace *parent_trace = nullptr) : target(o, ol, f), @@ -1991,7 +2006,7 @@ public: } } - Op(const object_t& o, const object_locator_t& ol, vector&& _ops, + Op(const object_t& o, const object_locator_t& ol, osdc_opvec&& _ops, int f, fu2::unique_function&& fin, version_t *ov, int *offset = nullptr, ZTracer::Trace *parent_trace = nullptr) : target(o, ol, f), @@ -2238,7 +2253,7 @@ public: SnapContext snapc; ceph::real_time mtime; - std::vector ops; + osdc_opvec ops; ceph::buffer::list inbl; version_t *pobjver{nullptr}; @@ -2519,7 +2534,7 @@ private: * and returned whenever an op is removed from the std::map * If throttle_op needs to throttle it will unlock client_lock. */ - int calc_op_budget(const std::vector& ops); + int calc_op_budget(const boost::container::small_vector_base& ops); void _throttle_op(Op *op, ceph::shunique_lock& sul, int op_size = 0); int _take_op_budget(Op *op, ceph::shunique_lock& sul) { @@ -2943,7 +2958,7 @@ public: o->priority = op.priority; o->snapid = snapid; o->outbl = pbl; - if (!o->outbl && op.size() == 1 && op.out_bl[0]->length()) + if (!o->outbl && op.size() == 1 && op.out_bl[0] && op.out_bl[0]->length()) o->outbl = op.out_bl[0]; o->out_bl.swap(op.out_bl); o->out_handler.swap(op.out_handler); @@ -2979,8 +2994,10 @@ public: o->priority = op.priority; o->snapid = snapid; o->outbl = pbl; - if (!o->outbl && op.size() == 1 && op.out_bl[0]->length()) - o->outbl = op.out_bl[0]; + // XXX + if (!o->outbl && op.size() == 1 && op.out_bl[0] && op.out_bl[0]->length()) { + o->outbl = op.out_bl[0]; + } o->out_bl.swap(op.out_bl); o->out_handler.swap(op.out_handler); o->out_rval.swap(op.out_rval); @@ -3111,7 +3128,8 @@ public: * @param extra_ops pointer to [array of] initial op[s] * @return index of final op (for caller to fill in) */ - int init_ops(std::vector& ops, int ops_count, ObjectOperation *extra_ops) { + int init_ops(boost::container::small_vector_base& ops, int ops_count, + ObjectOperation *extra_ops) { int i; int extra = 0; @@ -3134,7 +3152,7 @@ public: snapid_t snap, uint64_t *psize, ceph::real_time *pmtime, int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_STAT; C_Stat *fin = new C_Stat(psize, pmtime, onfinish); @@ -3162,7 +3180,7 @@ public: int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL, int op_flags = 0, ZTracer::Trace *parent_trace = nullptr) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_READ; ops[i].op.extent.offset = off; @@ -3194,7 +3212,7 @@ public: uint64_t off, ceph::buffer::list &cmp_bl, snapid_t snap, int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL, int op_flags = 0) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_CMPEXT; ops[i].op.extent.offset = off; @@ -3227,7 +3245,7 @@ public: __u32 trunc_seq, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL, int op_flags = 0) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_READ; ops[i].op.extent.offset = off; @@ -3247,7 +3265,7 @@ public: uint64_t off, uint64_t len, snapid_t snap, ceph::buffer::list *pbl, int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_MAPEXT; ops[i].op.extent.offset = off; @@ -3266,7 +3284,7 @@ public: const char *name, snapid_t snap, ceph::buffer::list *pbl, int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_GETXATTR; ops[i].op.xattr.name_len = (name ? strlen(name) : 0); @@ -3286,7 +3304,7 @@ public: snapid_t snap, std::map& attrset, int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_GETXATTRS; C_GetAttrs *fin = new C_GetAttrs(attrset, onfinish); @@ -3310,7 +3328,8 @@ public: // writes ceph_tid_t _modify(const object_t& oid, const object_locator_t& oloc, - std::vector& ops, ceph::real_time mtime, + osdc_opvec& ops, + ceph::real_time mtime, const SnapContext& snapc, int flags, Context *oncommit, version_t *objver = NULL) { @@ -3329,7 +3348,7 @@ public: Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL, int op_flags = 0, ZTracer::Trace *parent_trace = nullptr) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_WRITE; ops[i].op.extent.offset = off; @@ -3364,7 +3383,7 @@ public: Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_APPEND; ops[i].op.extent.offset = 0; @@ -3398,7 +3417,7 @@ public: Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL, int op_flags = 0) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_WRITE; ops[i].op.extent.offset = off; @@ -3421,7 +3440,7 @@ public: ceph::real_time mtime, int flags, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL, int op_flags = 0) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_WRITEFULL; ops[i].op.extent.offset = 0; @@ -3454,7 +3473,7 @@ public: Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL, int op_flags = 0) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_WRITESAME; ops[i].op.writesame.offset = off; @@ -3489,7 +3508,7 @@ public: uint64_t trunc_size, __u32 trunc_seq, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_TRUNCATE; ops[i].op.extent.offset = trunc_size; @@ -3507,7 +3526,7 @@ public: uint64_t off, uint64_t len, const SnapContext& snapc, ceph::real_time mtime, int flags, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_ZERO; ops[i].op.extent.offset = off; @@ -3525,7 +3544,7 @@ public: ceph::real_time mtime, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_ROLLBACK; ops[i].op.snap.snapid = snapid; @@ -3541,7 +3560,7 @@ public: int create_flags, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_CREATE; ops[i].op.flags = create_flags; @@ -3558,7 +3577,7 @@ public: const SnapContext& snapc, ceph::real_time mtime, int flags, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_DELETE; Op *o = new Op(oid, oloc, std::move(ops), flags | global_op_flags | @@ -3584,7 +3603,7 @@ public: ceph::real_time mtime, int flags, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_SETXATTR; ops[i].op.xattr.name_len = (name ? strlen(name) : 0); @@ -3606,7 +3625,7 @@ public: ceph::real_time mtime, int flags, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - std::vector ops; + osdc_opvec ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_RMXATTR; ops[i].op.xattr.name_len = (name ? strlen(name) : 0); -- 2.39.5