]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
hobject: clarify is_snap and has_snapset for max
authorSamuel Just <sjust@redhat.com>
Wed, 28 Sep 2016 20:25:42 +0000 (13:25 -0700)
committerDavid Zafman <dzafman@redhat.com>
Tue, 4 Oct 2016 04:43:34 +0000 (21:43 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit a2c27c9423b43b8c5633fb0af95f28b0de94b365)

src/common/hobject.h

index 69bb61116025da03f7c50c12cfa4f912b13c5b69..77f2081b7208e7480117f6e14b7de292fad8e140 100644 (file)
@@ -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 */