]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: drop explicit masking of implicit feature bits 39122/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 18 Dec 2020 15:14:13 +0000 (10:14 -0500)
committerNathan Cutler <ncutler@suse.com>
Thu, 28 Jan 2021 11:03:17 +0000 (12:03 +0100)
Now that the create image state machine is handling the masking
of implicit features, all callers to the state machine can skip
the need to perform the masking themselves.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit e1dd69391900a236fbda5e4cee58e9bdc20824fc)

Conflicts:
src/librbd/api/Migration.cc
- in octopus, this file does not mention RBD_FEATURES_IMPLICIT_ENABLE

src/librbd/api/Image.cc
src/librbd/api/Migration.cc
src/test/librbd/test_DeepCopy.cc
src/test/librbd/test_Migration.cc
src/test/rbd_mirror/test_ImageDeleter.cc
src/test/rbd_mirror/test_fixture.cc
src/tools/rbd_mirror/image_replayer/CreateImageRequest.cc

index 6b95ac696bcb97a09d7ba1d1bd8151c39d292c85..14ee0fdebf8acf99c441c7dcb1a7c00237f0d13b 100644 (file)
@@ -548,7 +548,7 @@ int Image<I>::deep_copy(I *src, librados::IoCtx& dest_md_ctx,
       return -EBUSY;
     }
 
-    features = (src->features & ~RBD_FEATURES_IMPLICIT_ENABLE);
+    features = src->features;
     src_size = src->get_image_size(src->snap_id);
   }
   uint64_t format = 2;
index 3d464d07951731e8568a1977ab4331cf8a7f9733..2325d5e978a568f281ec98c08253dbb667c915e5 100644 (file)
@@ -459,8 +459,6 @@ int Migration<I>::prepare(librados::IoCtx& io_ctx,
                       cls::rbd::MIGRATION_STATE_PREPARING, "", nullptr);
   r = migration.prepare();
 
-  opts.set(RBD_IMAGE_OPTION_FEATURES, features);
-
   return r;
 }
 
index 6bdb82c1cd9cc8bdaf817387538f912636a46a0a..2f02b53415df68283fb69baf7c2561782742626b 100644 (file)
@@ -411,7 +411,6 @@ struct TestDeepCopy : public TestFixture {
         int order = m_src_ictx->order;
         uint64_t features;
         ASSERT_EQ(0, librbd::get_features(m_src_ictx, &features));
-        features &= ~RBD_FEATURES_IMPLICIT_ENABLE;
 
         std::cout << "clone " << m_src_ictx->name << " -> " << clone_name
                   << std::endl;
index 69182ddcea5f614cc102878ade2e78cf62349d07..45b8ec2bb4abb0542deb45a3680c35cb0c7ea2ad 100644 (file)
@@ -293,7 +293,6 @@ struct TestMigration : public TestFixture {
     int order = m_ref_ictx->order;
     uint64_t features;
     ASSERT_EQ(0, librbd::get_features(m_ref_ictx, &features));
-    features &= ~RBD_FEATURES_IMPLICIT_ENABLE;
 
     std::string ref_clone_name = get_temp_image_name();
     std::string clone_name = get_temp_image_name();
@@ -406,7 +405,6 @@ struct TestMigration : public TestFixture {
     int order = m_ictx->order;
     uint64_t features;
     ASSERT_EQ(0, librbd::get_features(m_ictx, &features));
-    features &= ~RBD_FEATURES_IMPLICIT_ENABLE;
 
     std::string clone_name = get_temp_image_name();
     ASSERT_EQ(0, librbd::clone(m_ictx->md_ctx, m_ictx->name.c_str(), "snap1",
index 9bd2658daedb4c0f48b17072f89ad7d8f8a44255..329da40cb9ce17a81e8d419f2724ab66eeb2ff54 100644 (file)
@@ -73,8 +73,7 @@ public:
 
     m_local_image_id = librbd::util::generate_image_id(m_local_io_ctx);
     librbd::ImageOptions image_opts;
-    image_opts.set(RBD_IMAGE_OPTION_FEATURES,
-                   (RBD_FEATURES_ALL & ~RBD_FEATURES_IMPLICIT_ENABLE));
+    image_opts.set(RBD_IMAGE_OPTION_FEATURES, RBD_FEATURES_ALL);
     EXPECT_EQ(0, librbd::create(m_local_io_ctx, m_image_name, m_local_image_id,
                                 1 << 20, image_opts, GLOBAL_IMAGE_ID,
                                 m_remote_mirror_uuid, true));
index 092d41f5f651eda9496b0ea1c3d00481fea6401c..b0b345fb91a15da0a690b7c84ec0a02883579610 100644 (file)
@@ -89,9 +89,7 @@ void TestFixture::TearDown() {
 int TestFixture::create_image(librbd::RBD &rbd, librados::IoCtx &ioctx,
                               const std::string &name, uint64_t size) {
   int order = 18;
-  return rbd.create2(ioctx, name.c_str(), size,
-                     (RBD_FEATURES_ALL & ~RBD_FEATURES_IMPLICIT_ENABLE),
-                     &order);
+  return rbd.create2(ioctx, name.c_str(), size, RBD_FEATURES_ALL, &order);
 }
 
 int TestFixture::open_image(librados::IoCtx &io_ctx,
index 3cd57afc5f0865809493969bdbaf73fe36465cfe..5acb700c1815c1c277892d2e2684f12948cf57b7 100644 (file)
@@ -404,8 +404,7 @@ template <typename I>
 void CreateImageRequest<I>::populate_image_options(
     librbd::ImageOptions* image_options) {
   image_options->set(RBD_IMAGE_OPTION_FEATURES,
-                     (m_remote_image_ctx->features &
-                        ~RBD_FEATURES_IMPLICIT_ENABLE));
+                     m_remote_image_ctx->features);
   image_options->set(RBD_IMAGE_OPTION_ORDER, m_remote_image_ctx->order);
   image_options->set(RBD_IMAGE_OPTION_STRIPE_UNIT,
                      m_remote_image_ctx->stripe_unit);