summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-03-14 10:28:54 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-03-22 11:29:11 -0700
commit6f4853ca6c5f1d4834ba112179f7a6acfd43829c (patch)
treeaae4b73dec30e55662542c69fe8b2e4f247872f4
parent0f021500d4c08019e1ff9809f27dded2056faad4 (diff)
downloadceph-6f4853ca6c5f1d4834ba112179f7a6acfd43829c.tar.gz
osd: keep track of current osd subop num
This can be used later to generate unique subop versions in compound write operations. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/osd/ReplicatedPG.cc2
-rw-r--r--src/osd/ReplicatedPG.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index 50318fc5869..478f7d44318 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -1866,7 +1866,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
dout(10) << "do_osd_op " << soid << " " << ops << dendl;
- for (vector<OSDOp>::iterator p = ops.begin(); p != ops.end(); ++p) {
+ for (vector<OSDOp>::iterator p = ops.begin(); p != ops.end(); ++p, ctx->current_osd_subop_num++) {
OSDOp& osd_op = *p;
ceph_osd_op& op = osd_op.op;
diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h
index 377ca8656a7..84a0dc7f201 100644
--- a/src/osd/ReplicatedPG.h
+++ b/src/osd/ReplicatedPG.h
@@ -279,6 +279,8 @@ public:
eversion_t at_version; // pg's current version pointer
eversion_t reply_version; // the version that we report the client (depends on the op)
+ int current_osd_subop_num;
+
ObjectStore::Transaction op_t, local_t;
vector<pg_log_entry_t> log;
@@ -305,6 +307,7 @@ public:
new_obs(_obs->oi, _obs->exists),
modify(false), user_modify(false),
bytes_written(0), bytes_read(0),
+ current_osd_subop_num(0),
obc(0), clone_obc(0), snapset_obc(0), data_off(0), reply(NULL), pg(_pg) {
if (_ssc) {
new_snapset = _ssc->snapset;