]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: do_op - do not create head object twice 28785/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 29 Jun 2019 00:36:15 +0000 (08:36 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 29 Jun 2019 01:26:24 +0000 (09:26 +0800)
That might be expensive, especially for the hot paths.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/PrimaryLogPG.cc

index 093cb3bce3fc3fd55199e2244678a79d1b8118a8..061dc3d8a5b452e26d400222cf166ac8b41a719f 100644 (file)
@@ -2029,12 +2029,8 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
   hobject_t missing_oid;
 
   // kludge around the fact that LIST_SNAPS sets CEPH_SNAPDIR for LIST_SNAPS
-  hobject_t _oid_head;
-  if (m->get_snapid() == CEPH_SNAPDIR) {
-    _oid_head = m->get_hobj().get_head();
-  }
   const hobject_t& oid =
-    m->get_snapid() == CEPH_SNAPDIR ? _oid_head : m->get_hobj();
+    m->get_snapid() == CEPH_SNAPDIR ? head : m->get_hobj();
 
   // make sure LIST_SNAPS is on CEPH_SNAPDIR and nothing else
   for (vector<OSDOp>::iterator p = m->ops.begin(); p != m->ops.end(); ++p) {