Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373534
b: refs/heads/master
c: cc4a38b
h: refs/heads/master
v: v3
  • Loading branch information
Alex Elder authored and Sage Weil committed May 2, 2013
1 parent 8cc0375 commit 415d57a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 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: 7097f8df6e679207c949673d2959505b59a1a30e
refs/heads/master: cc4a38bdd587a1843540989f262feb7bdc43c468
39 changes: 18 additions & 21 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ static int rbd_img_obj_request_submit(struct rbd_obj_request *obj_request);
static void rbd_img_parent_read(struct rbd_obj_request *obj_request);
static void rbd_dev_remove_parent(struct rbd_device *rbd_dev);

static int rbd_dev_refresh(struct rbd_device *rbd_dev, u64 *hver);
static int rbd_dev_v2_refresh(struct rbd_device *rbd_dev, u64 *hver);
static int rbd_dev_refresh(struct rbd_device *rbd_dev);
static int rbd_dev_v2_refresh(struct rbd_device *rbd_dev);

static int rbd_open(struct block_device *bdev, fmode_t mode)
{
Expand Down Expand Up @@ -2468,8 +2468,7 @@ static void rbd_img_parent_read(struct rbd_obj_request *obj_request)
obj_request_done_set(obj_request);
}

static int rbd_obj_notify_ack(struct rbd_device *rbd_dev,
u64 ver, u64 notify_id)
static int rbd_obj_notify_ack(struct rbd_device *rbd_dev, u64 notify_id)
{
struct rbd_obj_request *obj_request;
struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
Expand All @@ -2487,7 +2486,7 @@ static int rbd_obj_notify_ack(struct rbd_device *rbd_dev,
obj_request->callback = rbd_obj_request_put;

osd_req_op_watch_init(obj_request->osd_req, 0, CEPH_OSD_OP_NOTIFY_ACK,
notify_id, ver, 0);
notify_id, 0, 0);
rbd_osd_req_format_read(obj_request);

ret = rbd_obj_request_submit(osdc, obj_request);
Expand All @@ -2501,17 +2500,16 @@ static int rbd_obj_notify_ack(struct rbd_device *rbd_dev,
static void rbd_watch_cb(u64 ver, u64 notify_id, u8 opcode, void *data)
{
struct rbd_device *rbd_dev = (struct rbd_device *)data;
u64 hver;

if (!rbd_dev)
return;

dout("%s: \"%s\" notify_id %llu opcode %u\n", __func__,
rbd_dev->header_name, (unsigned long long) notify_id,
(unsigned int) opcode);
(void)rbd_dev_refresh(rbd_dev, &hver);
rbd_dev->header_name, (unsigned long long)notify_id,
(unsigned int)opcode);
(void)rbd_dev_refresh(rbd_dev);

rbd_obj_notify_ack(rbd_dev, hver, notify_id);
rbd_obj_notify_ack(rbd_dev, notify_id);
}

/*
Expand Down Expand Up @@ -3014,7 +3012,7 @@ static void rbd_update_mapping_size(struct rbd_device *rbd_dev)
/*
* only read the first part of the ondisk header, without the snaps info
*/
static int rbd_dev_v1_refresh(struct rbd_device *rbd_dev, u64 *hver)
static int rbd_dev_v1_refresh(struct rbd_device *rbd_dev)
{
int ret;
struct rbd_image_header h;
Expand Down Expand Up @@ -3051,7 +3049,7 @@ static int rbd_dev_v1_refresh(struct rbd_device *rbd_dev, u64 *hver)
return ret;
}

static int rbd_dev_refresh(struct rbd_device *rbd_dev, u64 *hver)
static int rbd_dev_refresh(struct rbd_device *rbd_dev)
{
u64 image_size;
int ret;
Expand All @@ -3060,9 +3058,9 @@ static int rbd_dev_refresh(struct rbd_device *rbd_dev, u64 *hver)
image_size = rbd_dev->header.image_size;
mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
if (rbd_dev->image_format == 1)
ret = rbd_dev_v1_refresh(rbd_dev, hver);
ret = rbd_dev_v1_refresh(rbd_dev);
else
ret = rbd_dev_v2_refresh(rbd_dev, hver);
ret = rbd_dev_v2_refresh(rbd_dev);
mutex_unlock(&ctl_mutex);
if (ret)
rbd_warn(rbd_dev, "got notification but failed to "
Expand Down Expand Up @@ -3271,7 +3269,7 @@ static ssize_t rbd_image_refresh(struct device *dev,
struct rbd_device *rbd_dev = dev_to_rbd_dev(dev);
int ret;

ret = rbd_dev_refresh(rbd_dev, NULL);
ret = rbd_dev_refresh(rbd_dev);

return ret < 0 ? ret : size;
}
Expand Down Expand Up @@ -3824,7 +3822,7 @@ static int rbd_dev_spec_update(struct rbd_device *rbd_dev)
return ret;
}

static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev, u64 *ver)
static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev)
{
size_t size;
int ret;
Expand All @@ -3850,7 +3848,7 @@ static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev, u64 *ver)

ret = rbd_obj_method_sync(rbd_dev, rbd_dev->header_name,
"rbd", "get_snapcontext", NULL, 0,
reply_buf, size, ver);
reply_buf, size, NULL);
dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
if (ret < 0)
goto out;
Expand Down Expand Up @@ -3978,7 +3976,7 @@ static const char *rbd_dev_snap_info(struct rbd_device *rbd_dev, u32 which,
return ERR_PTR(-EINVAL);
}

static int rbd_dev_v2_refresh(struct rbd_device *rbd_dev, u64 *hver)
static int rbd_dev_v2_refresh(struct rbd_device *rbd_dev)
{
int ret;

Expand All @@ -3989,7 +3987,7 @@ static int rbd_dev_v2_refresh(struct rbd_device *rbd_dev, u64 *hver)
goto out;
rbd_update_mapping_size(rbd_dev);

ret = rbd_dev_v2_snap_context(rbd_dev, hver);
ret = rbd_dev_v2_snap_context(rbd_dev);
dout("rbd_dev_v2_snap_context returned %d\n", ret);
if (ret)
goto out;
Expand Down Expand Up @@ -4591,7 +4589,6 @@ static int rbd_dev_v1_probe(struct rbd_device *rbd_dev)
static int rbd_dev_v2_probe(struct rbd_device *rbd_dev)
{
int ret;
u64 ver = 0;

ret = rbd_dev_v2_image_size(rbd_dev);
if (ret)
Expand Down Expand Up @@ -4641,7 +4638,7 @@ static int rbd_dev_v2_probe(struct rbd_device *rbd_dev)

/* Get the snapshot context, plus the header version */

ret = rbd_dev_v2_snap_context(rbd_dev, &ver);
ret = rbd_dev_v2_snap_context(rbd_dev);
if (ret)
goto out_err;

Expand Down

0 comments on commit 415d57a

Please sign in to comment.