]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: new RBD_FEATURE_DATA_POOL feature bit
authorJason Dillaman <dillaman@redhat.com>
Wed, 5 Oct 2016 02:48:16 +0000 (22:48 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 5 Oct 2016 12:11:00 +0000 (08:11 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/include/rbd/features.h
src/librbd/image/CreateRequest.cc

index 3e3509d4691af4e335c42cbd62341281a0f2867e..15e0d18545723f5b64633f6ee3d070017b82ed19 100644 (file)
@@ -1,18 +1,20 @@
 #ifndef CEPH_RBD_FEATURES_H
 #define CEPH_RBD_FEATURES_H
 
-#define RBD_FEATURE_LAYERING           (1<<0)
-#define RBD_FEATURE_STRIPINGV2         (1<<1)
-#define RBD_FEATURE_EXCLUSIVE_LOCK     (1<<2)
-#define RBD_FEATURE_OBJECT_MAP         (1<<3)
-#define RBD_FEATURE_FAST_DIFF           (1<<4)
-#define RBD_FEATURE_DEEP_FLATTEN        (1<<5)
-#define RBD_FEATURE_JOURNALING          (1<<6)
+#define RBD_FEATURE_LAYERING           (1ULL<<0)
+#define RBD_FEATURE_STRIPINGV2         (1ULL<<1)
+#define RBD_FEATURE_EXCLUSIVE_LOCK     (1ULL<<2)
+#define RBD_FEATURE_OBJECT_MAP         (1ULL<<3)
+#define RBD_FEATURE_FAST_DIFF           (1ULL<<4)
+#define RBD_FEATURE_DEEP_FLATTEN        (1ULL<<5)
+#define RBD_FEATURE_JOURNALING          (1ULL<<6)
+#define RBD_FEATURE_DATA_POOL           (1ULL<<7)
 
 /// features that make an image inaccessible for read or write by
 /// clients that don't understand them
-#define RBD_FEATURES_INCOMPATIBLE      (RBD_FEATURE_LAYERING |       \
-                                        RBD_FEATURE_STRIPINGV2)
+#define RBD_FEATURES_INCOMPATIBLE      (RBD_FEATURE_LAYERING       | \
+                                        RBD_FEATURE_STRIPINGV2     | \
+                                         RBD_FEATURE_DATA_POOL)
 
 /// features that make an image unwritable by clients that don't understand them
 #define RBD_FEATURES_RW_INCOMPATIBLE   (RBD_FEATURES_INCOMPATIBLE  | \
@@ -28,7 +30,8 @@
                                          RBD_FEATURE_OBJECT_MAP     | \
                                          RBD_FEATURE_FAST_DIFF      | \
                                          RBD_FEATURE_DEEP_FLATTEN   | \
-                                         RBD_FEATURE_JOURNALING)
+                                         RBD_FEATURE_JOURNALING     | \
+                                         RBD_FEATURE_DATA_POOL)
 
 /// features that may be dynamically enabled or disabled
 #define RBD_FEATURES_MUTABLE            (RBD_FEATURE_EXCLUSIVE_LOCK | \
index 7a9daaf30fcbe6c899646fd9ee8e52c2c4767670..4a1378cdc08065dd0ad262a3d6206700759cd259 100644 (file)
@@ -98,6 +98,9 @@ CreateRequest<I>::CreateRequest(IoCtx &ioctx, std::string &imgname, std::string
   }
 
   m_force_non_primary = !non_primary_global_image_id.empty();
+
+  // TODO
+  m_features &= ~RBD_FEATURE_DATA_POOL;
 }
 
 template<typename I>
@@ -250,7 +253,8 @@ void CreateRequest<I>::create_image() {
 
   librados::ObjectWriteOperation op;
   op.create(true);
-  cls_client::create_image(&op, m_size, m_order, m_features, oss.str());
+  cls_client::create_image(&op, m_size, m_order, m_features, oss.str(),
+                           /* TODO */-1);
 
   using klass = CreateRequest<I>;
   librados::AioCompletion *comp =