From: Sage Weil Date: Fri, 3 Feb 2017 14:49:12 +0000 (-0500) Subject: msg/Connection: has_features() X-Git-Tag: v12.0.1~467^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d1d63f89573bce18ff4098d6605fbfaa7ee64ad8;p=ceph.git msg/Connection: has_features() 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 --- diff --git a/src/msg/Connection.h b/src/msg/Connection.h index 2362895e256b..4c6ce86cb521 100644 --- a/src/msg/Connection.h +++ b/src/msg/Connection.h @@ -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; }