From: Samuel Just Date: Wed, 28 Sep 2016 20:25:42 +0000 (-0700) Subject: hobject: clarify is_snap and has_snapset for max X-Git-Tag: v10.2.4~78^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2176c847d588fbec654653db48c4ad156a87aac2;p=ceph.git hobject: clarify is_snap and has_snapset for max Signed-off-by: Samuel Just (cherry picked from commit a2c27c9423b43b8c5633fb0af95f28b0de94b365) --- diff --git a/src/common/hobject.h b/src/common/hobject.h index 69bb61116025..77f2081b7208 100644 --- a/src/common/hobject.h +++ b/src/common/hobject.h @@ -162,14 +162,14 @@ public: return snap == CEPH_NOSNAP; } - /// @return true if object is neither head nor snapdir + /// @return true if object is neither head nor snapdir nor max bool is_snap() const { - return (snap != CEPH_NOSNAP) && (snap != CEPH_SNAPDIR); + return !is_max() && !is_head() && !is_snapdir(); } /// @return true iff the object should have a snapset in it's attrs bool has_snapset() const { - return !is_snap(); + return is_head() || is_snapdir(); } /* Do not use when a particular hash function is needed */