Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331689
b: refs/heads/master
c: 6e14b1a
h: refs/heads/master
i:
  331687: 9fa3c4d
v: v3
  • Loading branch information
Alex Elder committed Oct 1, 2012
1 parent 85ac0eb commit 901d1cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 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: b8b1e2db52de61f575981d0c23da785a7c5b4a77
refs/heads/master: 6e14b1a6c3b8d7e48ece68733d2dac0464611ee4
16 changes: 12 additions & 4 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2241,7 +2241,7 @@ static int rbd_dev_v2_features(struct rbd_device *rbd_dev)
&rbd_dev->header.features);
}

static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev)
static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev, u64 *ver)
{
size_t size;
int ret;
Expand Down Expand Up @@ -2269,7 +2269,7 @@ static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev)
"rbd", "get_snapcontext",
NULL, 0,
reply_buf, size,
CEPH_OSD_FLAG_READ, NULL);
CEPH_OSD_FLAG_READ, ver);
dout("%s: rbd_req_sync_exec returned %d\n", __func__, ret);
if (ret < 0)
goto out;
Expand Down Expand Up @@ -2906,6 +2906,7 @@ static int rbd_dev_v2_probe(struct rbd_device *rbd_dev)
{
size_t size;
int ret;
u64 ver = 0;

/*
* Image id was filled in by the caller. Record the header
Expand Down Expand Up @@ -2936,11 +2937,18 @@ static int rbd_dev_v2_probe(struct rbd_device *rbd_dev)
if (ret < 0)
goto out_err;

/* Get the snapshot context */
/* crypto and compression type aren't (yet) supported for v2 images */

rbd_dev->header.crypt_type = 0;
rbd_dev->header.comp_type = 0;

ret = rbd_dev_v2_snap_context(rbd_dev);
/* Get the snapshot context, plus the header version */

ret = rbd_dev_v2_snap_context(rbd_dev, &ver);
if (ret)
goto out_err;
rbd_dev->header.obj_version = ver;

rbd_dev->image_format = 2;

dout("discovered version 2 image, header name is %s\n",
Expand Down

0 comments on commit 901d1cf

Please sign in to comment.