]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: add new deep-flatten RBD feature
authorJason Dillaman <dillaman@redhat.com>
Wed, 15 Apr 2015 18:25:08 +0000 (14:25 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 7 May 2015 01:51:31 +0000 (21:51 -0400)
Copy-on-read/write will now use an empty snapshot context to
deep-copy the object through all existing snapshots.  With the
deep-flatten feature enabled, the flatten operation will now
disconnect a child image from its parent even if it has existing
snapshots.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
doc/man/8/rbd.rst
src/include/rbd/features.h
src/rbd.cc
src/test/cli/rbd/help.t

index c0ccba176acd017272014aa1b3402579e652259e..8679af770a3d0043a2e708a43e8a0c9880dee238 100644 (file)
@@ -136,6 +136,7 @@ Parameters
    exclusive-lock: exclusive locking support
    object-map: object map support (requires exclusive-lock)
    fast-diff: fast diff calculations (requires object-map)
+   deep-flatten: snapshot flatten support
 
 .. option:: --image-shared
 
index 17b68d4e7f1a0bb88cae22c0e034bdd7e3037163..34d688d7b46aec9377291503fbacd1a7f1baf0bd 100644 (file)
@@ -6,23 +6,26 @@
 #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_FEATURES_INCOMPATIBLE      (RBD_FEATURE_LAYERING |       \
                                         RBD_FEATURE_STRIPINGV2)
 
-#define RBD_FEATURES_RW_INCOMPATIBLE   (RBD_FEATURES_INCOMPATIBLE  \
+#define RBD_FEATURES_RW_INCOMPATIBLE   (RBD_FEATURES_INCOMPATIBLE  | \
                                         RBD_FEATURE_EXCLUSIVE_LOCK | \
-                                        RBD_FEATURE_OBJECT_MAP | \
-                                         RBD_FEATURE_FAST_DIFF)
+                                        RBD_FEATURE_OBJECT_MAP     | \
+                                         RBD_FEATURE_FAST_DIFF      | \
+                                         RBD_FEATURE_DEEP_FLATTEN)
 
-#define RBD_FEATURES_ALL               (RBD_FEATURE_LAYERING |       \
-                                        RBD_FEATURE_STRIPINGV2 |     \
+#define RBD_FEATURES_ALL               (RBD_FEATURE_LAYERING       | \
+                                        RBD_FEATURE_STRIPINGV2     | \
                                         RBD_FEATURE_EXCLUSIVE_LOCK | \
-                                         RBD_FEATURE_OBJECT_MAP |     \
-                                         RBD_FEATURE_FAST_DIFF)
+                                         RBD_FEATURE_OBJECT_MAP     | \
+                                         RBD_FEATURE_FAST_DIFF      | \
+                                         RBD_FEATURE_DEEP_FLATTEN)
 
 #define RBD_FEATURES_MUTABLE            (RBD_FEATURE_EXCLUSIVE_LOCK | \
-                                         RBD_FEATURE_OBJECT_MAP | \
+                                         RBD_FEATURE_OBJECT_MAP     | \
                                          RBD_FEATURE_FAST_DIFF)
 
 #endif
index 2d46bea0af2aea0bb7d774273d9038485c35ba30..e50eeb30c7c1e729b0cdd28acf42a85505a92380 100644 (file)
@@ -82,7 +82,8 @@ static std::map<uint64_t, std::string> feature_mapping =
     RBD_FEATURE_STRIPINGV2, "striping")(
     RBD_FEATURE_EXCLUSIVE_LOCK, "exclusive-lock")(
     RBD_FEATURE_OBJECT_MAP, "object-map")(
-    RBD_FEATURE_FAST_DIFF, "fast-diff");
+    RBD_FEATURE_FAST_DIFF, "fast-diff")(
+    RBD_FEATURE_DEEP_FLATTEN, "deep-flatten");
 
 void usage()
 {
index 7ec32e997ee5b86b07b581067090edee3efc17c0..a9b721cfb336237784387e82aecc492384763b4a 100644 (file)
     --allow-shrink                     allow shrinking of an image when resizing
   
   Supported image features:
-    layering (+), striping (+), exclusive-lock (*), object-map (*), fast-diff (*)
+    layering (+), striping (+), exclusive-lock (*), object-map (*), fast-diff (*), deep-flatten
   
     (*) supports enabling/disabling on existing images
     (+) enabled by default for new images if features are not specified