]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
librbd: drop explicit masking of implicit feature bits
authorJason Dillaman <dillaman@redhat.com>
Fri, 18 Dec 2020 15:14:13 +0000 (10:14 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 18 Dec 2020 15:14:13 +0000 (10:14 -0500)
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>
src/librbd/api/Image.cc
src/librbd/api/Migration.cc
src/librbd/image/CloneRequest.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 db2a82eb5c6963dd448042ba0b5788063b5b0dcb..b68824d9d6f35ecdc6fc75e78a8f3f7728e3d840 100644 (file)
@@ -549,7 +549,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 1f0cf68bed46e601d2ccb70ca8c3b38e3bdbd1a2..957c872ac5515ab970113e6ef646dbb0f7d563ef 100644 (file)
@@ -467,7 +467,6 @@ int Migration<I>::prepare(librados::IoCtx& io_ctx,
     lderr(cct) << "librbd does not support requested features" << dendl;
     return -ENOSYS;
   }
-  features &= ~RBD_FEATURES_IMPLICIT_ENABLE;
   opts.set(RBD_IMAGE_OPTION_FEATURES, features);
 
   uint64_t order = src_image_ctx->order;
@@ -511,8 +510,6 @@ int Migration<I>::prepare(librados::IoCtx& io_ctx,
                       opts, nullptr);
   r = migration.prepare();
 
-  opts.set(RBD_IMAGE_OPTION_FEATURES, features);
-
   return r;
 }
 
index b022ea75a72f5f4ffde0e6c576c6eafafe89ea7c..7a955f06464bda84a5d46fe943f8ca9d9ed30ab0 100644 (file)
@@ -216,7 +216,6 @@ void CloneRequest<I>::validate_parent() {
   if (m_use_p_features) {
     m_features = p_features;
   }
-  m_features &= ~RBD_FEATURES_IMPLICIT_ENABLE;
 
   if (r < 0) {
     lderr(m_cct) << "unable to locate parent's snapshot" << dendl;
index 741a5d54485800514181bf06eafa7dd33c9a612d..1a512aa292c21eb3cead58529fe9c4a7399697cd 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 5f96d620e26048ee96e77bf1f6ae58a048cc2d9b..959eb0934754b647d98ffe24c97217f62251cafd 100644 (file)
@@ -294,7 +294,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();
@@ -407,7 +406,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 2febc6f32963160db83a52275a7aa7d83a19d17b..5fa5d6db51231c078f8725d0ba765e0b4619df01 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 23191da039883a49acdbf21decd826eb0090ec58..7abf0e3e2a5c26b4e19cd3bf104863b435301dbb 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 d7266b260ad239c4056e76662760981401e3ced7..641bb03e80f8c9b3792f1ba39f2643294405e703 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);