]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: drop explicit masking of implicit feature bits 39121/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:00:31 +0000 (12:00 +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 nautilus, 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 67f408e5fdc7fe5d148e07adb3285695bf8d6c6c..aa427535970e666c5dbd414a1c422a8daa036282 100644 (file)
@@ -547,7 +547,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 47df20a9b96012d9f6a163408cda419c486ff6d4..ae09d407ea06a059462602757e3ec2b5d3a6a577 100644 (file)
@@ -455,8 +455,6 @@ int Migration<I>::prepare(librados::IoCtx& io_ctx,
                       false, cls::rbd::MIGRATION_STATE_PREPARING, "", nullptr);
   r = migration.prepare();
 
-  opts.set(RBD_IMAGE_OPTION_FEATURES, features);
-
   return r;
 }
 
index 1f9148faa07f865d849e730552869838678916d5..aa00bdf1283f0b5935892b7c220d2f3ff4ba39f5 100644 (file)
@@ -410,7 +410,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 29bbdfbd5db22a053c75274cde6d57926319b060..c50996f9a22401e66fb5ac291e0e5ede73480e26 100644 (file)
@@ -292,7 +292,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();
@@ -405,7 +404,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 ea64d03871355a72482008b7f28fb822143f480b..93f311e3d08b832a76284fe2dd14f538bf51ad1c 100644 (file)
@@ -66,8 +66,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 8ef6858c3da7116012787540b5a4b81204dfb4f3..8d8236b2b87e5ba1d75bb0c8446cd630c50c2d8a 100644 (file)
@@ -459,8 +459,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);