diff options
author | Kefu Chai <kchai@redhat.com> | 2017-06-08 05:20:02 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2017-06-08 05:46:26 +0200 |
commit | 161ea38fd5ec6e7ed8d19aa7f2015966af6c9ad5 (patch) | |
tree | e8a4561101daf5afb1800b42415fd58e91508606 /src/osdc | |
parent | common/ceph_context: s/atomic_t/std::atomic<>/ (diff) | |
download | ceph-161ea38fd5ec6e7ed8d19aa7f2015966af6c9ad5.tar.xz ceph-161ea38fd5ec6e7ed8d19aa7f2015966af6c9ad5.zip |
osdc/Objecter: s/atomic_t/std::atomic<>/
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/osdc')
-rw-r--r-- | src/osdc/Objecter.cc | 124 | ||||
-rw-r--r-- | src/osdc/Objecter.h | 80 |
2 files changed, 101 insertions, 103 deletions
diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 6582aec99e4..e34dfcb7543 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -237,7 +237,7 @@ void Objecter::update_crush_location() */ void Objecter::init() { - assert(!initialized.read()); + assert(!initialized); if (!logger) { PerfCountersBuilder pcb(cct, "objecter", l_osdc_first, l_osdc_last); @@ -387,7 +387,7 @@ void Objecter::init() cct->_conf->add_observer(this); - initialized.set(1); + initialized = true; } /* @@ -407,11 +407,11 @@ void Objecter::start(const OSDMap* o) void Objecter::shutdown() { - assert(initialized.read()); + assert(initialized); unique_lock wl(rwlock); - initialized.set(0); + initialized = false; cct->_conf->remove_observer(this); @@ -562,7 +562,7 @@ void Objecter::_send_linger(LingerOp *info, o->mtime = info->mtime; o->target = info->target; - o->tid = last_tid.inc(); + o->tid = ++last_tid; // do not resend this; we will send a new op to reregister o->should_resend = false; @@ -694,7 +694,7 @@ void Objecter::_send_linger_ping(LingerOp *info) o->should_resend = false; _send_op_account(o); MOSDOp *m = _prepare_osd_op(o); - o->tid = last_tid.inc(); + o->tid = ++last_tid; _session_op_assign(info->session, o); _send_op(o, m); info->ping_tid = o->tid; @@ -888,7 +888,7 @@ struct C_DoWatchNotify : public Context { void Objecter::handle_watch_notify(MWatchNotify *m) { shared_lock l(rwlock); - if (!initialized.read()) { + if (!initialized) { return; } @@ -931,7 +931,7 @@ void Objecter::_do_watch_notify(LingerOp *info, MWatchNotify *m) ldout(cct, 10) << __func__ << " " << *m << dendl; shared_lock l(rwlock); - assert(initialized.read()); + assert(initialized); if (info->canceled) { l.unlock(); @@ -961,7 +961,7 @@ void Objecter::_do_watch_notify(LingerOp *info, MWatchNotify *m) bool Objecter::ms_dispatch(Message *m) { ldout(cct, 10) << __func__ << " " << cct << " " << *m << dendl; - if (!initialized.read()) + if (!initialized) return false; switch (m->get_type()) { @@ -1134,7 +1134,7 @@ void Objecter::_scan_requests(OSDSession *s, void Objecter::handle_osd_map(MOSDMap *m) { shunique_lock sul(rwlock, acquire_unique); - if (!initialized.read()) + if (!initialized) return; assert(osdmap); @@ -2117,7 +2117,7 @@ void Objecter::tick() // we are only called by C_Tick tick_event = 0; - if (!initialized.read()) { + if (!initialized) { // we raced with shutdown ldout(cct, 10) << __func__ << " raced with shutdown" << dendl; return; @@ -2173,7 +2173,7 @@ void Objecter::tick() if (found) toping.insert(s); } - if (num_homeless_ops.read() || !toping.empty()) { + if (num_homeless_ops || !toping.empty()) { _maybe_request_map(); } @@ -2191,7 +2191,7 @@ void Objecter::tick() } // Make sure we don't resechedule if we wake up after shutdown - if (initialized.read()) { + if (initialized) { tick_event = timer.reschedule_me(ceph::make_timespan( cct->_conf->objecter_tick_interval)); } @@ -2264,7 +2264,7 @@ void Objecter::_op_submit_with_budget(Op *op, shunique_lock& sul, ceph_tid_t *ptid, int *ctx_budget) { - assert(initialized.read()); + assert(initialized); assert(op->ops.size() == op->out_bl.size()); assert(op->ops.size() == op->out_rval.size()); @@ -2283,7 +2283,7 @@ void Objecter::_op_submit_with_budget(Op *op, shunique_lock& sul, if (osd_timeout > timespan(0)) { if (op->tid == 0) - op->tid = last_tid.inc(); + op->tid = ++last_tid; auto tid = op->tid; op->ontimeout = timer.add_event(osd_timeout, [this, tid]() { @@ -2295,11 +2295,11 @@ void Objecter::_op_submit_with_budget(Op *op, shunique_lock& sul, void Objecter::_send_op_account(Op *op) { - inflight_ops.inc(); + inflight_ops++; // add to gather set(s) if (op->onfinish) { - num_in_flight.inc(); + num_in_flight++; } else { ldout(cct, 20) << " note: not requesting reply" << dendl; } @@ -2458,7 +2458,7 @@ void Objecter::_op_submit(Op *op, shunique_lock& sul, ceph_tid_t *ptid) OSDSession::unique_lock sl(s->lock); if (op->tid == 0) - op->tid = last_tid.inc(); + op->tid = ++last_tid; ldout(cct, 10) << "_op_submit oid " << op->target.base_oid << " '" << op->target.base_oloc << "' '" @@ -2485,12 +2485,12 @@ void Objecter::_op_submit(Op *op, shunique_lock& sul, ceph_tid_t *ptid) sl.unlock(); put_session(s); - ldout(cct, 5) << num_in_flight.read() << " in flight" << dendl; + ldout(cct, 5) << num_in_flight << " in flight" << dendl; } int Objecter::op_cancel(OSDSession *s, ceph_tid_t tid, int r) { - assert(initialized.read()); + assert(initialized); OSDSession::unique_lock sl(s->lock); @@ -2511,7 +2511,7 @@ int Objecter::op_cancel(OSDSession *s, ceph_tid_t tid, int r) << dendl; Op *op = p->second; if (op->onfinish) { - num_in_flight.dec(); + num_in_flight--; op->onfinish->complete(r); op->onfinish = NULL; } @@ -2948,7 +2948,7 @@ void Objecter::_session_op_assign(OSDSession *to, Op *op) to->ops[op->tid] = op; if (to->is_homeless()) { - num_homeless_ops.inc(); + num_homeless_ops++; } ldout(cct, 15) << __func__ << " " << to->osd << " " << op->tid << dendl; @@ -2960,7 +2960,7 @@ void Objecter::_session_op_remove(OSDSession *from, Op *op) // from->lock is locked if (from->is_homeless()) { - num_homeless_ops.dec(); + num_homeless_ops--; } from->ops.erase(op->tid); @@ -2976,7 +2976,7 @@ void Objecter::_session_linger_op_assign(OSDSession *to, LingerOp *op) assert(op->session == NULL); if (to->is_homeless()) { - num_homeless_ops.inc(); + num_homeless_ops++; } get_session(to); @@ -2993,7 +2993,7 @@ void Objecter::_session_linger_op_remove(OSDSession *from, LingerOp *op) // from->lock is locked unique if (from->is_homeless()) { - num_homeless_ops.dec(); + num_homeless_ops--; } from->linger_ops.erase(op->linger_id); @@ -3010,7 +3010,7 @@ void Objecter::_session_command_op_remove(OSDSession *from, CommandOp *op) // from->lock is locked if (from->is_homeless()) { - num_homeless_ops.dec(); + num_homeless_ops--; } from->command_ops.erase(op->tid); @@ -3027,7 +3027,7 @@ void Objecter::_session_command_op_assign(OSDSession *to, CommandOp *op) assert(op->tid); if (to->is_homeless()) { - num_homeless_ops.inc(); + num_homeless_ops++; } get_session(to); @@ -3075,7 +3075,7 @@ void Objecter::_cancel_linger_op(Op *op) assert(!op->should_resend); if (op->onfinish) { delete op->onfinish; - num_in_flight.dec(); + num_in_flight--; } _finish_op(op, 0); @@ -3101,7 +3101,7 @@ void Objecter::_finish_op(Op *op, int r) assert(check_latest_map_ops.find(op->tid) == check_latest_map_ops.end()); - inflight_ops.dec(); + inflight_ops++; op->put(); } @@ -3140,7 +3140,7 @@ MOSDOp *Objecter::_prepare_osd_op(Op *op) op->stamp = ceph::mono_clock::now(); hobject_t hobj = op->target.get_hobj(); - MOSDOp *m = new MOSDOp(client_inc.read(), op->tid, + MOSDOp *m = new MOSDOp(client_inc, op->tid, hobj, op->target.actual_pgid, osdmap->get_epoch(), flags, op->features); @@ -3301,7 +3301,7 @@ void Objecter::unregister_op(Op *op) put_session(op->session); op->session = NULL; - inflight_ops.dec(); + inflight_ops--; } /* This function DOES put the passed message before returning */ @@ -3313,7 +3313,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m) ceph_tid_t tid = m->get_tid(); shunique_lock sul(rwlock, ceph::acquire_shared); - if (!initialized.read()) { + if (!initialized) { m->put(); return; } @@ -3357,7 +3357,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m) (op->target.flags & CEPH_OSD_FLAG_WRITE)) { ldout(cct, 7) << "retrying write after first reply: " << tid << dendl; if (op->onfinish) { - num_in_flight.dec(); + num_in_flight--; } _session_op_remove(s, op); sl.unlock(); @@ -3393,7 +3393,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m) if (m->is_redirect_reply()) { ldout(cct, 5) << " got redirect reply; redirecting" << dendl; if (op->onfinish) - num_in_flight.dec(); + num_in_flight--; _session_op_remove(s, op); sl.unlock(); put_session(s); @@ -3414,7 +3414,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m) // new tid s->ops.erase(op->tid); - op->tid = last_tid.inc(); + op->tid = ++last_tid; _send_op(op); sl.unlock(); @@ -3477,7 +3477,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m) // only ever get back one (type of) ack ever. if (op->onfinish) { - num_in_flight.dec(); + num_in_flight--; onfinish = op->onfinish; op->onfinish = NULL; } @@ -3489,7 +3489,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m) ldout(cct, 15) << "handle_osd_op_reply completed tid " << tid << dendl; _finish_op(op, 0); - ldout(cct, 5) << num_in_flight.read() << " in flight" << dendl; + ldout(cct, 5) << num_in_flight << " in flight" << dendl; // serialize completions if (completion_lock.mutex()) { @@ -3513,7 +3513,7 @@ void Objecter::handle_osd_backoff(MOSDBackoff *m) { ldout(cct, 10) << __func__ << " " << *m << dendl; shunique_lock sul(rwlock, ceph::acquire_shared); - if (!initialized.read()) { + if (!initialized) { m->put(); return; } @@ -3808,7 +3808,7 @@ int Objecter::create_pool_snap(int64_t pool, string& snap_name, PoolOp *op = new PoolOp; if (!op) return -ENOMEM; - op->tid = last_tid.inc(); + op->tid = ++last_tid; op->pool = pool; op->name = snap_name; op->onfinish = onfinish; @@ -3841,7 +3841,7 @@ int Objecter::allocate_selfmanaged_snap(int64_t pool, snapid_t *psnapid, ldout(cct, 10) << "allocate_selfmanaged_snap; pool: " << pool << dendl; PoolOp *op = new PoolOp; if (!op) return -ENOMEM; - op->tid = last_tid.inc(); + op->tid = ++last_tid; op->pool = pool; C_SelfmanagedSnap *fin = new C_SelfmanagedSnap(psnapid, onfinish); op->onfinish = fin; @@ -3869,7 +3869,7 @@ int Objecter::delete_pool_snap(int64_t pool, string& snap_name, PoolOp *op = new PoolOp; if (!op) return -ENOMEM; - op->tid = last_tid.inc(); + op->tid = ++last_tid; op->pool = pool; op->name = snap_name; op->onfinish = onfinish; @@ -3889,7 +3889,7 @@ int Objecter::delete_selfmanaged_snap(int64_t pool, snapid_t snap, << snap << dendl; PoolOp *op = new PoolOp; if (!op) return -ENOMEM; - op->tid = last_tid.inc(); + op->tid = ++last_tid; op->pool = pool; op->onfinish = onfinish; op->pool_op = POOL_OP_DELETE_UNMANAGED_SNAP; @@ -3913,7 +3913,7 @@ int Objecter::create_pool(string& name, Context *onfinish, uint64_t auid, PoolOp *op = new PoolOp; if (!op) return -ENOMEM; - op->tid = last_tid.inc(); + op->tid = ++last_tid; op->pool = 0; op->name = name; op->onfinish = onfinish; @@ -3955,7 +3955,7 @@ int Objecter::delete_pool(const string &pool_name, Context *onfinish) void Objecter::_do_delete_pool(int64_t pool, Context *onfinish) { PoolOp *op = new PoolOp; - op->tid = last_tid.inc(); + op->tid = ++last_tid; op->pool = pool; op->name = "delete"; op->onfinish = onfinish; @@ -3976,7 +3976,7 @@ int Objecter::change_pool_auid(int64_t pool, Context *onfinish, uint64_t auid) ldout(cct, 10) << "change_pool_auid " << pool << " to " << auid << dendl; PoolOp *op = new PoolOp; if (!op) return -ENOMEM; - op->tid = last_tid.inc(); + op->tid = ++last_tid; op->pool = pool; op->name = "change_pool_auid"; op->onfinish = onfinish; @@ -4028,7 +4028,7 @@ void Objecter::handle_pool_op_reply(MPoolOpReply *m) { FUNCTRACE(); shunique_lock sul(rwlock, acquire_shared); - if (!initialized.read()) { + if (!initialized) { sul.unlock(); m->put(); return; @@ -4091,7 +4091,7 @@ done: int Objecter::pool_op_cancel(ceph_tid_t tid, int r) { - assert(initialized.read()); + assert(initialized); unique_lock wl(rwlock); @@ -4133,7 +4133,7 @@ void Objecter::get_pool_stats(list<string>& pools, ldout(cct, 10) << "get_pool_stats " << pools << dendl; PoolStatOp *op = new PoolStatOp; - op->tid = last_tid.inc(); + op->tid = ++last_tid; op->pools = pools; op->pool_stats = result; op->onfinish = onfinish; @@ -4172,7 +4172,7 @@ void Objecter::handle_get_pool_stats_reply(MGetPoolStatsReply *m) ceph_tid_t tid = m->get_tid(); unique_lock wl(rwlock); - if (!initialized.read()) { + if (!initialized) { m->put(); return; } @@ -4196,7 +4196,7 @@ void Objecter::handle_get_pool_stats_reply(MGetPoolStatsReply *m) int Objecter::pool_stat_op_cancel(ceph_tid_t tid, int r) { - assert(initialized.read()); + assert(initialized); unique_lock wl(rwlock); @@ -4234,7 +4234,7 @@ void Objecter::get_fs_stats(ceph_statfs& result, Context *onfinish) unique_lock l(rwlock); StatfsOp *op = new StatfsOp; - op->tid = last_tid.inc(); + op->tid = ++last_tid; op->stats = &result; op->onfinish = onfinish; if (mon_timeout > timespan(0)) { @@ -4267,7 +4267,7 @@ void Objecter::_fs_stats_submit(StatfsOp *op) void Objecter::handle_fs_stats_reply(MStatfsReply *m) { unique_lock wl(rwlock); - if (!initialized.read()) { + if (!initialized) { m->put(); return; } @@ -4292,7 +4292,7 @@ void Objecter::handle_fs_stats_reply(MStatfsReply *m) int Objecter::statfs_op_cancel(ceph_tid_t tid, int r) { - assert(initialized.read()); + assert(initialized); unique_lock wl(rwlock); @@ -4361,7 +4361,7 @@ void Objecter::_sg_read_finish(vector<ObjectExtent>& extents, void Objecter::ms_handle_connect(Connection *con) { ldout(cct, 10) << "ms_handle_connect " << con << dendl; - if (!initialized.read()) + if (!initialized) return; if (con->get_peer_type() == CEPH_ENTITY_TYPE_MON) @@ -4370,7 +4370,7 @@ void Objecter::ms_handle_connect(Connection *con) bool Objecter::ms_handle_reset(Connection *con) { - if (!initialized.read()) + if (!initialized) return false; if (con->get_peer_type() == CEPH_ENTITY_TYPE_OSD) { OSDSession *session = static_cast<OSDSession*>(con->get_priv()); @@ -4378,7 +4378,7 @@ bool Objecter::ms_handle_reset(Connection *con) ldout(cct, 1) << "ms_handle_reset " << con << " session " << session << " osd." << session->osd << dendl; unique_lock wl(rwlock); - if (!initialized.read()) { + if (!initialized) { wl.unlock(); return false; } @@ -4421,7 +4421,7 @@ bool Objecter::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) { - if (!initialized.read()) + if (!initialized) return false; if (dest_type == CEPH_ENTITY_TYPE_MON) return true; @@ -4457,7 +4457,7 @@ void Objecter::_dump_active(OSDSession *s) void Objecter::_dump_active() { - ldout(cct, 20) << "dump_active .. " << num_homeless_ops.read() << " homeless" + ldout(cct, 20) << "dump_active .. " << num_homeless_ops << " homeless" << dendl; for (map<int, OSDSession *>::iterator siter = osd_sessions.begin(); siter != osd_sessions.end(); ++siter) { @@ -4699,7 +4699,7 @@ void Objecter::blacklist_self(bool set) void Objecter::handle_command_reply(MCommandReply *m) { unique_lock wl(rwlock); - if (!initialized.read()) { + if (!initialized) { m->put(); return; } @@ -4756,7 +4756,7 @@ void Objecter::submit_command(CommandOp *c, ceph_tid_t *ptid) { shunique_lock sul(rwlock, ceph::acquire_unique); - ceph_tid_t tid = last_tid.inc(); + ceph_tid_t tid = ++last_tid; ldout(cct, 10) << "_submit_command " << tid << " " << c->cmd << dendl; c->tid = tid; @@ -4879,7 +4879,7 @@ void Objecter::_send_command(CommandOp *c) int Objecter::command_op_cancel(OSDSession *s, ceph_tid_t tid, int r) { - assert(initialized.read()); + assert(initialized); unique_lock wl(rwlock); @@ -4935,7 +4935,7 @@ Objecter::~Objecter() delete osdmap; assert(homeless_session->get_nref() == 1); - assert(num_homeless_ops.read() == 0); + assert(num_homeless_ops == 0); homeless_session->put(); assert(osd_sessions.empty()); diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 11319aa0f0b..4efdb9d08b0 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1192,15 +1192,15 @@ public: using Dispatcher::cct; std::multimap<string,string> crush_location; - atomic_t initialized; + std::atomic<bool> initialized{false}; private: - atomic64_t last_tid; - atomic_t inflight_ops; - atomic_t client_inc; + std::atomic<uint64_t> last_tid{0}; + std::atomic<unsigned> inflight_ops{0}; + std::atomic<int> client_inc{-1}; uint64_t max_linger_id; - atomic_t num_in_flight; - atomic_t global_op_flags; // flags which are applied to each IO op + std::atomic<unsigned> num_in_flight{0}; + std::atomic<int> global_op_flags{0}; // flags which are applied to each IO op bool keep_balanced_budget; bool honor_osdmap_full; bool osdmap_full_try; @@ -1860,7 +1860,7 @@ public: map<ceph_tid_t,PoolStatOp*> poolstat_ops; map<ceph_tid_t,StatfsOp*> statfs_ops; map<ceph_tid_t,PoolOp*> pool_ops; - atomic_t num_homeless_ops; + std::atomic<unsigned> num_homeless_ops{0}; OSDSession *homeless_session; @@ -1996,13 +1996,12 @@ private: double osd_timeout) : Dispatcher(cct_), messenger(m), monc(mc), finisher(fin), trace_endpoint("0.0.0.0", 0, "Objecter"), - osdmap(new OSDMap), initialized(0), last_tid(0), client_inc(-1), - max_linger_id(0), num_in_flight(0), global_op_flags(0), + osdmap(new OSDMap), + max_linger_id(0), keep_balanced_budget(false), honor_osdmap_full(true), osdmap_full_try(false), blacklist_events_enabled(false), last_seen_osdmap_version(0), last_seen_pgmap_version(0), logger(NULL), tick_event(0), m_request_state_hook(NULL), - num_homeless_ops(0), homeless_session(new OSDSession(cct, -1)), mon_timeout(ceph::make_timespan(mon_timeout)), osd_timeout(ceph::make_timespan(osd_timeout)), @@ -2128,7 +2127,7 @@ public: void op_submit(Op *op, ceph_tid_t *ptid = NULL, int *ctx_budget = NULL); bool is_active() { shared_lock l(rwlock); - return !((!inflight_ops.read()) && linger_ops.empty() && + return !((!inflight_ops) && linger_ops.empty() && poolstat_ops.empty() && statfs_ops.empty()); } @@ -2149,8 +2148,8 @@ public: void dump_pool_stat_ops(Formatter *fmt) const; void dump_statfs_ops(Formatter *fmt) const; - int get_client_incarnation() const { return client_inc.read(); } - void set_client_incarnation(int inc) { client_inc.set(inc); } + int get_client_incarnation() const { return client_inc; } + void set_client_incarnation(int inc) { client_inc = inc; } bool have_map(epoch_t epoch); /// wait for epoch; true if we already have it @@ -2161,15 +2160,14 @@ public: void _get_latest_version(epoch_t oldest, epoch_t neweset, Context *fin); /** Get the current set of global op flags */ - int get_global_op_flags() { return global_op_flags.read(); } + int get_global_op_flags() const { return global_op_flags; } /** Add a flag to the global op flags, not really atomic operation */ void add_global_op_flags(int flag) { - global_op_flags.set(global_op_flags.read() | flag); + global_op_flags.fetch_or(flag); } - /** Clear the passed flags from the global op flag set, not really - atomic operation */ + /** Clear the passed flags from the global op flag set */ void clear_global_op_flag(int flags) { - global_op_flags.set(global_op_flags.read() & ~flags); + global_op_flags.fetch_and(~flags); } /// cancel an in-progress request with the given return code @@ -2224,7 +2222,7 @@ public: Context *oncommit, version_t *objver = NULL, osd_reqid_t reqid = osd_reqid_t(), ZTracer::Trace *parent_trace = nullptr) { - Op *o = new Op(oid, oloc, op.ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, op.ops, flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver, nullptr, parent_trace); o->priority = op.priority; o->mtime = mtime; @@ -2253,7 +2251,7 @@ public: int *data_offset = NULL, uint64_t features = 0, ZTracer::Trace *parent_trace = nullptr) { - Op *o = new Op(oid, oloc, op.ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, op.ops, flags | global_op_flags | CEPH_OSD_FLAG_READ, onack, objver, data_offset, parent_trace); o->priority = op.priority; o->snapid = snapid; @@ -2287,7 +2285,7 @@ public: int *ctx_budget) { Op *o = new Op(object_t(), oloc, op.ops, - flags | global_op_flags.read() | CEPH_OSD_FLAG_READ | + flags | global_op_flags | CEPH_OSD_FLAG_READ | CEPH_OSD_FLAG_IGNORE_OVERLAY, onack, NULL); o->target.precalc_pgid = true; @@ -2375,7 +2373,7 @@ public: 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); - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_READ, fin, objver); o->snapid = snap; o->outbl = &fin->bl; @@ -2407,7 +2405,7 @@ public: ops[i].op.extent.truncate_size = 0; ops[i].op.extent.truncate_seq = 0; ops[i].op.flags = op_flags; - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_READ, onfinish, objver, nullptr, parent_trace); o->snapid = snap; o->outbl = pbl; @@ -2439,7 +2437,7 @@ public: ops[i].op.extent.truncate_seq = 0; ops[i].indata = cmp_bl; ops[i].op.flags = op_flags; - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_READ, onfinish, objver); o->snapid = snap; return o; @@ -2471,7 +2469,7 @@ public: ops[i].op.extent.truncate_size = trunc_size; ops[i].op.extent.truncate_seq = trunc_seq; ops[i].op.flags = op_flags; - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_READ, onfinish, objver); o->snapid = snap; o->outbl = pbl; @@ -2490,7 +2488,7 @@ public: ops[i].op.extent.length = len; ops[i].op.extent.truncate_size = 0; ops[i].op.extent.truncate_seq = 0; - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_READ, onfinish, objver); o->snapid = snap; o->outbl = pbl; @@ -2509,7 +2507,7 @@ public: ops[i].op.xattr.value_len = 0; if (name) ops[i].indata.append(name); - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_READ, onfinish, objver); o->snapid = snap; o->outbl = pbl; @@ -2526,7 +2524,7 @@ public: int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_GETXATTRS; C_GetAttrs *fin = new C_GetAttrs(attrset, onfinish); - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_READ, fin, objver); o->snapid = snap; o->outbl = &fin->bl; @@ -2539,7 +2537,7 @@ public: snapid_t snap, bufferlist *pbl, int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { - return read(oid, oloc, 0, 0, snap, pbl, flags | global_op_flags.read() | + return read(oid, oloc, 0, 0, snap, pbl, flags | global_op_flags | CEPH_OSD_FLAG_READ, onfinish, objver, extra_ops); } @@ -2550,7 +2548,7 @@ public: const SnapContext& snapc, int flags, Context *oncommit, version_t *objver = NULL) { - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver); o->mtime = mtime; o->snapc = snapc; @@ -2574,7 +2572,7 @@ public: ops[i].op.extent.truncate_seq = 0; ops[i].indata = bl; ops[i].op.flags = op_flags; - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver, nullptr, parent_trace); o->mtime = mtime; @@ -2608,7 +2606,7 @@ public: ops[i].op.extent.truncate_size = 0; ops[i].op.extent.truncate_seq = 0; ops[i].indata = bl; - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver); o->mtime = mtime; o->snapc = snapc; @@ -2643,7 +2641,7 @@ public: ops[i].op.extent.truncate_seq = trunc_seq; ops[i].indata = bl; ops[i].op.flags = op_flags; - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver); o->mtime = mtime; o->snapc = snapc; @@ -2664,7 +2662,7 @@ public: ops[i].op.extent.length = bl.length(); ops[i].indata = bl; ops[i].op.flags = op_flags; - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver); o->mtime = mtime; o->snapc = snapc; @@ -2698,7 +2696,7 @@ public: ops[i].op.writesame.data_length = bl.length(); ops[i].indata = bl; ops[i].op.flags = op_flags; - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver); o->mtime = mtime; o->snapc = snapc; @@ -2731,7 +2729,7 @@ public: ops[i].op.extent.offset = trunc_size; ops[i].op.extent.truncate_size = trunc_size; ops[i].op.extent.truncate_seq = trunc_seq; - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver); o->mtime = mtime; o->snapc = snapc; @@ -2748,7 +2746,7 @@ public: ops[i].op.op = CEPH_OSD_OP_ZERO; ops[i].op.extent.offset = off; ops[i].op.extent.length = len; - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver); o->mtime = mtime; o->snapc = snapc; @@ -2781,7 +2779,7 @@ public: int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_CREATE; ops[i].op.flags = create_flags; - Op *o = new Op(oid, oloc, ops, global_flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, global_flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver); o->mtime = mtime; o->snapc = snapc; @@ -2797,7 +2795,7 @@ public: vector<OSDOp> ops; int i = init_ops(ops, 1, extra_ops); ops[i].op.op = CEPH_OSD_OP_DELETE; - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver); o->mtime = mtime; o->snapc = snapc; @@ -2828,7 +2826,7 @@ public: if (name) ops[i].indata.append(name); ops[i].indata.append(bl); - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver); o->mtime = mtime; o->snapc = snapc; @@ -2848,7 +2846,7 @@ public: ops[i].op.xattr.value_len = 0; if (name) ops[i].indata.append(name); - Op *o = new Op(oid, oloc, ops, flags | global_op_flags.read() | + Op *o = new Op(oid, oloc, ops, flags | global_op_flags | CEPH_OSD_FLAG_WRITE, oncommit, objver); o->mtime = mtime; o->snapc = snapc; |