From d1d63f89573bce18ff4098d6605fbfaa7ee64ad8 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 3 Feb 2017 09:49:12 -0500 Subject: [PATCH] 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 --- src/msg/Connection.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/msg/Connection.h b/src/msg/Connection.h index 2362895e256..4c6ce86cb52 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; } -- 2.39.5