summaryrefslogtreecommitdiffstats
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
authorAlex Elder2013-04-05 21:46:02 +0200
committerSage Weil2013-05-02 06:18:35 +0200
commit04017e29bbcf0673d8a6af616c56e395d05f5971 (patch)
tree09bd1c613cf85e4410755e2931cf3c21fa5da488 /drivers/block/rbd.c
parentlibceph: add, don't set data for a message (diff)
downloadkernel-qcow2-linux-04017e29bbcf0673d8a6af616c56e395d05f5971.tar.gz
kernel-qcow2-linux-04017e29bbcf0673d8a6af616c56e395d05f5971.tar.xz
kernel-qcow2-linux-04017e29bbcf0673d8a6af616c56e395d05f5971.zip
libceph: make method call data be a separate data item
Right now the data for a method call is specified via a pointer and length, and it's copied--along with the class and method name--into a pagelist data item to be sent to the osd. Instead, encode the data in a data item separate from the class and method names. This will allow large amounts of data to be supplied to methods without copying. Only rbd uses the class functionality right now, and when it really needs this it will probably need to use a page array rather than a page list. But this simple implementation demonstrates the functionality on the osd client, and that's enough for now. This resolves: http://tracker.ceph.com/issues/4104 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r--drivers/block/rbd.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 6f7a52cf75c7..11b7987cb75f 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1847,8 +1847,19 @@ static int rbd_obj_method_sync(struct rbd_device *rbd_dev,
goto out;
osd_req_op_cls_init(obj_request->osd_req, 0, CEPH_OSD_OP_CALL,
- class_name, method_name,
- outbound, outbound_size);
+ class_name, method_name);
+ if (outbound_size) {
+ struct ceph_pagelist *pagelist;
+
+ pagelist = kmalloc(sizeof (*pagelist), GFP_NOFS);
+ if (!pagelist)
+ goto out;
+
+ ceph_pagelist_init(pagelist);
+ ceph_pagelist_append(pagelist, outbound, outbound_size);
+ osd_req_op_cls_request_data_pagelist(obj_request->osd_req, 0,
+ pagelist);
+ }
osd_req_op_cls_response_data_pages(obj_request->osd_req, 0,
obj_request->pages, inbound_size,
0, false, false);