]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: make do_sub_op() more efficient
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 23 May 2016 11:18:40 +0000 (19:18 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 24 May 2016 11:56:25 +0000 (19:56 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/ReplicatedPG.cc

index beeb2c2b33fa62111f1b68adf49f6698610543f6..6f31bbf66fe7b591ef7006b9e52d56189cafacbe 100644 (file)
@@ -3145,17 +3145,17 @@ void ReplicatedPG::do_sub_op(OpRequestRef op)
   assert(m->get_type() == MSG_OSD_SUBOP);
   dout(15) << "do_sub_op " << *op->get_req() << dendl;
 
-  OSDOp *first = NULL;
-  if (m->ops.size() >= 1) {
-    first = &m->ops[0];
-  }
-
   if (!is_peered()) {
     waiting_for_peered.push_back(op);
     op->mark_delayed("waiting for active");
     return;
   }
 
+  OSDOp *first = NULL;
+  if (m->ops.size() >= 1) {
+    first = &m->ops[0];
+  }
+
   if (first) {
     switch (first->op.op) {
     case CEPH_OSD_OP_DELETE: