From: Sage Weil Date: Fri, 21 Nov 2014 23:11:00 +0000 (-0800) Subject: osd/ReplicatedPG: pass obc to OpContext ctor X-Git-Tag: v0.91~76 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1c5bba670bdd61269769247b7b84ee4fbd98fd1c;p=ceph.git osd/ReplicatedPG: pass obc to OpContext ctor We always set it, except for the handle_watch_timeout caller, which needs to. Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 480dfcf9527d..0c69981d97e1 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1680,11 +1680,8 @@ void ReplicatedPG::do_op(OpRequestRef& op) } } - OpContext *ctx = new OpContext(op, m->get_reqid(), m->ops, - &obc->obs, obc->ssc, - this); + OpContext *ctx = new OpContext(op, m->get_reqid(), m->ops, obc, this); ctx->op_t = pgbackend->get_transaction(); - ctx->obc = obc; if (!obc->obs.exists) ctx->snapset_obc = get_object_context(obc->obs.oi.soid.get_snapdir(), false); @@ -7297,11 +7294,9 @@ ReplicatedPG::RepGather *ReplicatedPG::simple_repop_create(ObjectContextRef obc) vector ops; ceph_tid_t rep_tid = osd->get_tid(); osd_reqid_t reqid(osd->get_cluster_msgr_name(), 0, rep_tid); - OpContext *ctx = new OpContext(OpRequestRef(), reqid, ops, - &obc->obs, obc->ssc, this); + OpContext *ctx = new OpContext(OpRequestRef(), reqid, ops, obc, this); ctx->op_t = pgbackend->get_transaction(); ctx->mtime = ceph_clock_now(g_ceph_context); - ctx->obc = obc; RepGather *repop = new_repop(ctx, obc, rep_tid); return repop; } @@ -7444,8 +7439,7 @@ void ReplicatedPG::handle_watch_timeout(WatchRef watch) vector ops; ceph_tid_t rep_tid = osd->get_tid(); osd_reqid_t reqid(osd->get_cluster_msgr_name(), 0, rep_tid); - OpContext *ctx = new OpContext(OpRequestRef(), reqid, ops, - &obc->obs, obc->ssc, this); + OpContext *ctx = new OpContext(OpRequestRef(), reqid, ops, obc, this); ctx->op_t = pgbackend->get_transaction(); ctx->mtime = ceph_clock_now(cct); ctx->at_version = get_next_version(); diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 5f2ce6491db1..30da075e6b5a 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -539,15 +539,18 @@ public: bool release_snapset_obc; OpContext(OpRequestRef _op, osd_reqid_t _reqid, vector& _ops, - ObjectState *_obs, SnapSetContext *_ssc, + ObjectContextRef& obc, ReplicatedPG *_pg) : - op(_op), reqid(_reqid), ops(_ops), obs(_obs), snapset(0), - new_obs(_obs->oi, _obs->exists), + op(_op), reqid(_reqid), ops(_ops), + obs(&obc->obs), + snapset(0), + new_obs(obs->oi, obs->exists), modify(false), user_modify(false), undirty(false), cache_evict(false), ignore_cache(false), bytes_written(0), bytes_read(0), user_at_version(0), current_osd_subop_num(0), op_t(NULL), + obc(obc), data_off(0), reply(NULL), pg(_pg), num_read(0), num_write(0), @@ -557,9 +560,9 @@ public: lock_to_release(NONE), on_finish(NULL), release_snapset_obc(false) { - if (_ssc) { - new_snapset = _ssc->snapset; - snapset = &_ssc->snapset; + if (obc->ssc) { + new_snapset = obc->ssc->snapset; + snapset = &obc->ssc->snapset; } } void reset_obs(ObjectContextRef obc) {