[^^]+ (re)
\tformat: 2 (esc)
\tfeatures: layering, exclusive-lock, object-map, fast-diff, deep-flatten (esc)
+ \top_features: (esc)
\tflags: (esc)
\tcreate_timestamp:* (glob)
$ rbd info bar --format json | python -mjson.tool | sed 's/,$/, /'
"name": "bar",
"object_size": 4194304,
"objects": 256,
+ "op_features": [],
"order": 22,
"size": 1073741824
}
<feature>fast-diff</feature>
<feature>deep-flatten</feature>
</features>
+ <op_features></op_features>
<flags></flags>
<create_timestamp>*</create_timestamp> (glob)
</image>
[^^]+ (re)
\tformat: 2 (esc)
\tfeatures: layering, exclusive-lock, object-map, fast-diff, deep-flatten (esc)
+ \top_features: (esc)
\tflags: (esc)
\tcreate_timestamp:* (glob)
\tprotected: True (esc)
"name": "bar",
"object_size": 4194304,
"objects": 128,
+ "op_features": [],
"order": 22,
"protected": "true",
"size": 536870912
<feature>fast-diff</feature>
<feature>deep-flatten</feature>
</features>
+ <op_features></op_features>
<flags></flags>
<create_timestamp>*</create_timestamp> (glob)
<protected>true</protected>
[^^]+ (re)
\tformat: 2 (esc)
\tfeatures: layering, exclusive-lock, object-map, fast-diff, deep-flatten (esc)
+ \top_features: (esc)
\tflags: (esc)
\tcreate_timestamp:* (glob)
\tprotected: False (esc)
"name": "bar",
"object_size": 4194304,
"objects": 256,
+ "op_features": [],
"order": 22,
"protected": "false",
"size": 1073741824
<feature>fast-diff</feature>
<feature>deep-flatten</feature>
</features>
+ <op_features></op_features>
<flags></flags>
<create_timestamp>*</create_timestamp> (glob)
<protected>false</protected>
[^^]+ (re)
\tformat: 2 (esc)
\tfeatures: layering (esc)
+ \top_features: (esc)
\tflags: (esc)
\tcreate_timestamp:* (glob)
$ rbd info baz --format json | python -mjson.tool | sed 's/,$/, /'
"name": "baz",
"object_size": 4194304,
"objects": 512,
+ "op_features": [],
"order": 22,
"size": 2147483648
}
<features>
<feature>layering</feature>
</features>
+ <op_features></op_features>
<flags></flags>
<create_timestamp>*</create_timestamp> (glob)
</image>
[^^]+ (re)
\tformat: 2 (esc)
\tfeatures: layering, exclusive-lock, object-map, fast-diff (esc)
+ \top_features: (esc)
\tflags: (esc)
\tcreate_timestamp:* (glob)
$ rbd info rbd_other/child --format json | python -mjson.tool | sed 's/,$/, /'
"name": "child",
"object_size": 4194304,
"objects": 128,
+ "op_features": [],
"order": 22,
"size": 536870912
}
<feature>object-map</feature>
<feature>fast-diff</feature>
</features>
+ <op_features></op_features>
<flags></flags>
<create_timestamp>*</create_timestamp> (glob)
</image>
[^^]+ (re)
\tformat: 2 (esc)
\tfeatures: layering, exclusive-lock, object-map, fast-diff (esc)
+ \top_features: (esc)
\tflags: (esc)
\tcreate_timestamp:* (glob)
\tprotected: False (esc)
"name": "child",
"object_size": 4194304,
"objects": 128,
+ "op_features": [],
"order": 22,
"parent": {
"image": "bar",
<feature>object-map</feature>
<feature>fast-diff</feature>
</features>
+ <op_features></op_features>
<flags></flags>
<create_timestamp>*</create_timestamp> (glob)
<protected>false</protected>
[^^]+ (re)
\tformat: 2 (esc)
\tfeatures: layering, exclusive-lock, object-map, fast-diff, deep-flatten (esc)
+ \top_features: (esc)
\tflags: (esc)
\tcreate_timestamp:* (glob)
$ rbd info rbd_other/deep-flatten-child --format json | python -mjson.tool | sed 's/,$/, /'
"name": "deep-flatten-child",
"object_size": 4194304,
"objects": 128,
+ "op_features": [],
"order": 22,
"size": 536870912
}
<feature>fast-diff</feature>
<feature>deep-flatten</feature>
</features>
+ <op_features></op_features>
<flags></flags>
<create_timestamp>*</create_timestamp> (glob)
</image>
[^^]+ (re)
\tformat: 2 (esc)
\tfeatures: layering, exclusive-lock, object-map, fast-diff, deep-flatten (esc)
+ \top_features: (esc)
\tflags: (esc)
\tcreate_timestamp:* (glob)
\tprotected: False (esc)
"name": "deep-flatten-child",
"object_size": 4194304,
"objects": 128,
+ "op_features": [],
"order": 22,
"protected": "false",
"size": 536870912
<feature>fast-diff</feature>
<feature>deep-flatten</feature>
</features>
+ <op_features></op_features>
<flags></flags>
<create_timestamp>*</create_timestamp> (glob)
<protected>false</protected>
format_bitmask(f, "feature", at::ImageFeatures::FEATURE_MAPPING, features);
}
+static void format_op_features(Formatter *f, uint64_t op_features)
+{
+ static std::map<uint64_t, std::string> mapping = {
+ {RBD_OPERATION_FEATURE_CLONE_V2, RBD_OPERATION_FEATURE_NAME_CLONE_V2},
+ {RBD_OPERATION_FEATURE_GROUP, RBD_OPERATION_FEATURE_NAME_GROUP},
+ {RBD_OPERATION_FEATURE_SNAP_TRASH, RBD_OPERATION_FEATURE_NAME_SNAP_TRASH}};
+ format_bitmask(f, "op_feature", mapping, op_features);
+}
+
static void format_flags(Formatter *f, uint64_t flags)
{
std::map<uint64_t, std::string> mapping = {
if (r < 0)
return r;
+ uint64_t op_features;
+ r = image.get_op_features(&op_features);
+ if (r < 0) {
+ return r;
+ }
+
r = image.get_flags(&flags);
if (r < 0) {
return r;
if (!old_format) {
format_features(f, features);
+ format_op_features(f, op_features);
format_flags(f, flags);
}