Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347559
b: refs/heads/master
c: d889140
h: refs/heads/master
i:
  347557: 9a7c427
  347555: ef9e7a5
  347551: c64a76d
v: v3
  • Loading branch information
Alex Elder committed Oct 10, 2012
1 parent 8662fe5 commit b97ea2f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 117973fb4c91f3fd913127577e9f71b3aa6cb556
refs/heads/master: d889140c4a1c5edb6a7bd90392b9d878bfaccfb6
16 changes: 15 additions & 1 deletion trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@
#define RBD_IMAGE_ID_LEN_MAX 64
#define RBD_OBJ_PREFIX_LEN_MAX 64

/* Feature bits */

#define RBD_FEATURE_LAYERING 1

/* Features supported by this (client software) implementation. */

#define RBD_FEATURES_ALL (0)

/*
* An RBD device name will be "rbd#", where the "rbd" comes from
* RBD_DRV_NAME above, and # is a unique integer identifier.
Expand Down Expand Up @@ -2226,6 +2234,7 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id,
__le64 features;
__le64 incompat;
} features_buf = { 0 };
u64 incompat;
int ret;

ret = rbd_req_sync_exec(rbd_dev, rbd_dev->header_name,
Expand All @@ -2236,6 +2245,11 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id,
dout("%s: rbd_req_sync_exec returned %d\n", __func__, ret);
if (ret < 0)
return ret;

incompat = le64_to_cpu(features_buf.incompat);
if (incompat & ~RBD_FEATURES_ALL)
return -ENOTSUPP;

*snap_features = le64_to_cpu(features_buf.features);

dout(" snap_id 0x%016llx features = 0x%016llx incompat = 0x%016llx\n",
Expand Down Expand Up @@ -2977,7 +2991,7 @@ static int rbd_dev_v2_probe(struct rbd_device *rbd_dev)
if (ret < 0)
goto out_err;

/* Get the features for the image */
/* Get the and check features for the image */

ret = rbd_dev_v2_features(rbd_dev);
if (ret < 0)
Expand Down

0 comments on commit b97ea2f

Please sign in to comment.