Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331675
b: refs/heads/master
c: 3cb4a68
h: refs/heads/master
i:
  331673: ea99646
  331671: e27f32d
v: v3
  • Loading branch information
Alex Elder committed Oct 1, 2012
1 parent 718662a commit c01ff2f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 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: 3ee4001e0c875ce8ebcdf5ea305e9a105b3687bd
refs/heads/master: 3cb4a687c72bd16c95f514933d68884eacac4e4e
31 changes: 21 additions & 10 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1437,23 +1437,33 @@ static int rbd_req_sync_notify(struct rbd_device *rbd_dev)
}

/*
* Request sync osd read
* Synchronous osd object method call
*/
static int rbd_req_sync_exec(struct rbd_device *rbd_dev,
const char *object_name,
const char *class_name,
const char *method_name,
const char *data,
int len,
const char *outbound,
size_t outbound_size,
int flags,
u64 *ver)
{
struct ceph_osd_req_op *ops;
int class_name_len = strlen(class_name);
int method_name_len = strlen(method_name);
int payload_size;
int ret;

ops = rbd_create_rw_ops(1, CEPH_OSD_OP_CALL,
class_name_len + method_name_len + len);
/*
* Any input parameters required by the method we're calling
* will be sent along with the class and method names as
* part of the message payload. That data and its size are
* supplied via the indata and indata_len fields (named from
* the perspective of the server side) in the OSD request
* operation.
*/
payload_size = class_name_len + method_name_len + outbound_size;
ops = rbd_create_rw_ops(1, CEPH_OSD_OP_CALL, payload_size);
if (!ops)
return -ENOMEM;

Expand All @@ -1462,13 +1472,12 @@ static int rbd_req_sync_exec(struct rbd_device *rbd_dev,
ops[0].cls.method_name = method_name;
ops[0].cls.method_len = (__u8) method_name_len;
ops[0].cls.argc = 0;
ops[0].cls.indata = data;
ops[0].cls.indata_len = len;
ops[0].cls.indata = outbound;
ops[0].cls.indata_len = outbound_size;

ret = rbd_req_sync_op(rbd_dev, NULL,
CEPH_NOSNAP,
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
ops,
flags, ops,
object_name, 0, 0, NULL, NULL, ver);

rbd_destroy_ops(ops);
Expand Down Expand Up @@ -1780,7 +1789,9 @@ static int rbd_header_add_snap(struct rbd_device *rbd_dev,

ret = rbd_req_sync_exec(rbd_dev, rbd_dev->header_name,
"rbd", "snap_add",
data, p - data, NULL);
data, (size_t) (p - data),
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
NULL);

kfree(data);

Expand Down

0 comments on commit c01ff2f

Please sign in to comment.