]> 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)
committerSamuel Just <sjust@redhat.com>
Wed, 28 Sep 2016 20:25:54 +0000 (13:25 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/common/hobject.h

index d82157a7bb16f342da1f9f3d0e2d40473f0c5d8f..3f6ddd1eeae4e9bf5625216831011d7d8b12dc7d 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 */