]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: fix op_num offset/labels
authorSage Weil <sage.weil@dreamhost.com>
Mon, 12 Mar 2012 18:21:48 +0000 (11:21 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Mon, 12 Mar 2012 18:22:27 +0000 (11:22 -0700)
Start at 0, not 1.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/os/ObjectStore.cc

index 5dc6ada1fbffd21f389844c1c33ea1388d637b4c..288e95f88a93322009a7f84add0af64f0029b2a0 100644 (file)
@@ -10,7 +10,6 @@ void ObjectStore::Transaction::dump(ceph::Formatter *f)
   int op_num = 0;
   while (i.have_op()) {
     int op = i.get_op();
-    op_num++;
     switch (op) {
     case Transaction::OP_NOP:
       f->open_object_section("nop");
@@ -350,6 +349,7 @@ void ObjectStore::Transaction::dump(ceph::Formatter *f)
       f->close_section();
       return;
     }
+    op_num++;
   }
   f->close_section();
 }
@@ -360,7 +360,6 @@ void ObjectStore::Transaction::dump(ostream& out)
   int op_num = 0;
   while (i.have_op()) {
     int op = i.get_op();
-    op_num++;
     switch (op) {
     case Transaction::OP_NOP:
       break;
@@ -590,6 +589,7 @@ void ObjectStore::Transaction::dump(ostream& out)
       out << op_num << ": unknown op code " << op << "\n";
       return;
     }
+    op_num++;
   }
 }