]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
msg/Connection: has_features()
authorSage Weil <sage@redhat.com>
Fri, 3 Feb 2017 14:49:12 +0000 (09:49 -0500)
committerSage Weil <sage@redhat.com>
Mon, 6 Feb 2017 20:43:50 +0000 (15:43 -0500)
Test for multiple features all being set together.  Note that this can be
used with the CEPH_FEATUREMASK_ defines to safely test for reused feature
bits.

Signed-off-by: Sage Weil <sage@redhat.com>
src/msg/Connection.h

index 2362895e256b22039a22ae5a6e6c387d47eb377a..4c6ce86cb521b51e7f69099677a0f3241f49ee3e 100644 (file)
@@ -164,6 +164,9 @@ public:
 
   uint64_t get_features() const { return features; }
   bool has_feature(uint64_t f) const { return features & f; }
+  bool has_features(uint64_t f) const {
+    return (features & f) == f;
+  }
   void set_features(uint64_t f) { features = f; }
   void set_feature(uint64_t f) { features |= f; }