]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PrimaryLogPG: more constness
authorKefu Chai <kchai@redhat.com>
Sat, 29 Jun 2019 06:30:16 +0000 (14:30 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 29 Jun 2019 06:32:08 +0000 (14:32 +0800)
use `hobject_t::get_head()` instead of relying on the fact that head
object's snap is `CEPH_NOSNAP`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/PrimaryLogPG.cc

index 093cb3bce3fc3fd55199e2244678a79d1b8118a8..6e9ef361a6ebd7bd6aef2a9615d2146f8c6d5dba 100644 (file)
@@ -1767,8 +1767,7 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
 
   dout(20) << __func__ << ": op " << *m << dendl;
 
-  hobject_t head = m->get_hobj();
-  head.snap = CEPH_NOSNAP;
+  const hobject_t head = m->get_hobj().get_head();
 
   if (!info.pgid.pgid.contains(
        info.pgid.pgid.get_split_bits(pool.info.get_pg_num()), head)) {