From: Kefu Chai Date: Sat, 29 Jun 2019 06:30:16 +0000 (+0800) Subject: osd/PrimaryLogPG: more constness X-Git-Tag: v15.1.0~2339^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F28786%2Fhead;p=ceph.git osd/PrimaryLogPG: more constness use `hobject_t::get_head()` instead of relying on the fact that head object's snap is `CEPH_NOSNAP`. Signed-off-by: Kefu Chai --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 093cb3bce3fc..6e9ef361a6eb 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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)) {