librbd: add new RBD_FEATURE_JOURNALING feature code

When enabled, all mutable operations against an RBD image
will be recorded to a journal prior to changing the underlying
RBD image.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
Jason Dillaman 2015-07-06 11:53:21 -04:00
parent 773713b078
commit 750771c6ff
4 changed files with 17 additions and 10 deletions

View File

@ -141,6 +141,7 @@ Parameters
* object-map: object map support (requires exclusive-lock)
* fast-diff: fast diff calculations (requires object-map)
* deep-flatten: snapshot flatten support
* journaling: journaled IO support (requires exclusive-lock)
.. option:: --image-shared

View File

@ -7,6 +7,7 @@
#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)
/// features that make an image inaccessible for read or write by
/// clients that don't understand them
@ -18,24 +19,28 @@
RBD_FEATURE_EXCLUSIVE_LOCK | \
RBD_FEATURE_OBJECT_MAP | \
RBD_FEATURE_FAST_DIFF | \
RBD_FEATURE_DEEP_FLATTEN)
RBD_FEATURE_DEEP_FLATTEN | \
RBD_FEATURE_JOURNALING)
#define RBD_FEATURES_ALL (RBD_FEATURE_LAYERING | \
RBD_FEATURE_STRIPINGV2 | \
RBD_FEATURE_EXCLUSIVE_LOCK | \
RBD_FEATURE_OBJECT_MAP | \
RBD_FEATURE_FAST_DIFF | \
RBD_FEATURE_DEEP_FLATTEN)
RBD_FEATURE_DEEP_FLATTEN | \
RBD_FEATURE_JOURNALING)
/// features that may be dynamically enabled or disabled
#define RBD_FEATURES_MUTABLE (RBD_FEATURE_EXCLUSIVE_LOCK | \
RBD_FEATURE_OBJECT_MAP | \
RBD_FEATURE_FAST_DIFF)
RBD_FEATURE_FAST_DIFF | \
RBD_FEATURE_JOURNALING)
/// features that only work when used with a single client
/// using the image for writes
#define RBD_FEATURES_SINGLE_CLIENT (RBD_FEATURE_EXCLUSIVE_LOCK | \
RBD_FEATURE_OBJECT_MAP | \
RBD_FEATURE_FAST_DIFF)
RBD_FEATURE_FAST_DIFF | \
RBD_FEATURE_JOURNALING)
#endif

View File

@ -122,7 +122,7 @@
--order arg object order [12 <= order <= 25]
--image-feature arg image features
[layering(+), striping(+), exclusive-lock(*),
object-map(*), fast-diff(*), deep-flatten]
object-map(*), fast-diff(*), deep-flatten, journaling(*)]
--image-shared shared image
--stripe-unit arg stripe unit
--stripe-count arg stripe count
@ -176,7 +176,7 @@
--order arg object order [12 <= order <= 25]
--image-feature arg image features
[layering(+), striping(+), exclusive-lock(*),
object-map(*), fast-diff(*), deep-flatten]
object-map(*), fast-diff(*), deep-flatten, journaling(*)]
--image-shared shared image
--stripe-unit arg stripe unit
--stripe-count arg stripe count
@ -279,7 +279,7 @@
(example: [<pool-name>/]<image-name>)
<features> image features
[layering, striping, exclusive-lock, object-map,
fast-diff, deep-flatten]
fast-diff, deep-flatten, journaling]
Optional arguments
-p [ --pool ] arg pool name
@ -296,7 +296,7 @@
(example: [<pool-name>/]<image-name>)
<features> image features
[layering, striping, exclusive-lock, object-map,
fast-diff, deep-flatten]
fast-diff, deep-flatten, journaling]
Optional arguments
-p [ --pool ] arg pool name
@ -406,7 +406,7 @@
--order arg object order [12 <= order <= 25]
--image-feature arg image features
[layering(+), striping(+), exclusive-lock(*),
object-map(*), fast-diff(*), deep-flatten]
object-map(*), fast-diff(*), deep-flatten, journaling(*)]
--image-shared shared image
--stripe-unit arg stripe unit
--stripe-count arg stripe count

View File

@ -22,7 +22,8 @@ const std::map<uint64_t, std::string> ImageFeatures::FEATURE_MAPPING = {
{RBD_FEATURE_EXCLUSIVE_LOCK, "exclusive-lock"},
{RBD_FEATURE_OBJECT_MAP, "object-map"},
{RBD_FEATURE_FAST_DIFF, "fast-diff"},
{RBD_FEATURE_DEEP_FLATTEN, "deep-flatten"}};
{RBD_FEATURE_DEEP_FLATTEN, "deep-flatten"},
{RBD_FEATURE_JOURNALING, "journaling"}};
Format::Formatter Format::create_formatter(bool pretty) const {
if (value == "json") {