Skip to contentSkip to conversation

rbd: update feature bits

PATCH In review Alex Elder 2 participants 2 messages Apr 11, 2013

Subsystems (2)
lore
Share & tools
lore

Alex Elder

author
#0 lore raw

PATCH 1/1 rbd: update feature bits

There is a new rbd feature bit defined for "fancy striping." Add it to the ones defined in the kernel client.

Change RBD_FEATURES_ALL so it represents the set of all feature bits (rather than just the ones we support). Define a new symbol RBD_FEATURES_SUPPORTED to indicate the supported ones.

---
 drivers/block/rbd.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/block/rbd.c +5 -2
index 11b7987..503e64f 100644
@@ -73,11 +73,14 @@
 
 /* Feature bits */
 
-#define RBD_FEATURE_LAYERING      1
+#define RBD_FEATURE_LAYERING	(1<<0)
+#define RBD_FEATURE_STRIPINGV2	(1<<1)
+#define RBD_FEATURES_ALL \
+	    (RBD_FEATURE_LAYERING | RBD_FEATURE_STRIPINGV2)
 
 /* Features supported by this (client software) implementation. */
 
-#define RBD_FEATURES_ALL          (0)
+#define RBD_FEATURES_SUPPORTED	(0)
 
 /*
  * An RBD device name will be "rbd#", where the "rbd" comes from
@@ -2843,7 +2846,7 @@ static int _rbd_dev_v2_snap_features(struct

rbd_device *rbd_dev, u64 snap_id,
return ret;

incompat = le64_to_cpu(features_buf.incompat);
- if (incompat & ~RBD_FEATURES_ALL)
+ if (incompat & ~RBD_FEATURES_SUPPORTED)
return -ENXIO;

*snap_features = le64_to_cpu(features_buf.features);

Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 44 lines · Alex Elder

There is a new rbd feature bit defined for "fancy striping." Add it to the ones defined in the kernel client.

Change RBD_FEATURES_ALL so it represents the set of all feature bits (rather than just the ones we support). Define a new symbol RBD_FEATURES_SUPPORTED to indicate the supported ones.

---
  drivers/block/rbd.c |    9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)
drivers/block/rbd.c +6 -3
index 11b7987..503e64f 100644
@@ -73,11 +73,14 @@
 
  /* Feature bits */
 
-#define RBD_FEATURE_LAYERING      1
+#define RBD_FEATURE_LAYERING	(1<<0)
+#define RBD_FEATURE_STRIPINGV2	(1<<1)
+#define RBD_FEATURES_ALL \
+	    (RBD_FEATURE_LAYERING | RBD_FEATURE_STRIPINGV2)
 
  /* Features supported by this (client software) implementation. */
 
-#define RBD_FEATURES_ALL          (0)
+#define RBD_FEATURES_SUPPORTED	(0)
 
  /*
   * An RBD device name will be "rbd#", where the "rbd" comes from
@@ -2843,7 +2846,7 @@ static int _rbd_dev_v2_snap_features(struct
 rbd_device *rbd_dev, u64 snap_id,
  		return ret;
 
  	incompat = le64_to_cpu(features_buf.incompat);
-	if (incompat & ~RBD_FEATURES_ALL)
+	if (incompat & ~RBD_FEATURES_SUPPORTED)
  		return -ENXIO;
 
  	*snap_features = le64_to_cpu(features_buf.features);