From c0801af32d2771b9a8ae9100fb4ca1f6da1af50a Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 16 Jan 2018 12:45:48 -0500 Subject: [PATCH] cls/rbd: add new op feature bits for groups and snap trash Signed-off-by: Jason Dillaman --- src/include/rbd/features.h | 8 +++++++- src/test/cls_rbd/test_cls_rbd.cc | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/include/rbd/features.h b/src/include/rbd/features.h index 36ab22928e758..5e6e06f5aa277 100644 --- a/src/include/rbd/features.h +++ b/src/include/rbd/features.h @@ -77,10 +77,16 @@ #define RBD_FEATURES_INTERNAL (RBD_FEATURE_OPERATIONS) #define RBD_OPERATION_FEATURE_CLONE_V2 (1ULL<<0) +#define RBD_OPERATION_FEATURE_GROUP (1ULL<<1) +#define RBD_OPERATION_FEATURE_SNAP_TRASH (1ULL<<2) #define RBD_OPERATION_FEATURE_NAME_CLONE_V2 "clone" +#define RBD_OPERATION_FEATURE_NAME_GROUP "group" +#define RBD_OPERATION_FEATURE_NAME_SNAP_TRASH "snap-trash" /// all valid operation features -#define RBD_OPERATION_FEATURES_ALL (RBD_OPERATION_FEATURE_CLONE_V2) +#define RBD_OPERATION_FEATURES_ALL (RBD_OPERATION_FEATURE_CLONE_V2 | \ + RBD_OPERATION_FEATURE_GROUP | \ + RBD_OPERATION_FEATURE_SNAP_TRASH) #endif diff --git a/src/test/cls_rbd/test_cls_rbd.cc b/src/test/cls_rbd/test_cls_rbd.cc index 5543048a084d1..f1058a49ee35d 100644 --- a/src/test/cls_rbd/test_cls_rbd.cc +++ b/src/test/cls_rbd/test_cls_rbd.cc @@ -2524,6 +2524,7 @@ TEST_F(TestClsRbd, op_features) ASSERT_EQ(0, get_features(&ioctx, oid, CEPH_NOSNAP, &features)); ASSERT_EQ(0u, features); + op_features = RBD_OPERATION_FEATURES_ALL; mask = RBD_OPERATION_FEATURES_ALL; ASSERT_EQ(0, op_features_set(&ioctx, oid, op_features, mask)); ASSERT_EQ(0, op_features_get(&ioctx, oid, &actual_op_features)); @@ -2541,7 +2542,7 @@ TEST_F(TestClsRbd, op_features) ~RBD_OPERATION_FEATURE_CLONE_V2; ASSERT_EQ(expected_op_features, actual_op_features); - mask = 0; + mask = RBD_OPERATION_FEATURES_ALL; ASSERT_EQ(0, op_features_set(&ioctx, oid, op_features, mask)); ASSERT_EQ(0, get_features(&ioctx, oid, CEPH_NOSNAP, &features)); ASSERT_EQ(0u, features); -- 2.39.5