summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-02-14 19:16:43 +0100
committerSage Weil <sage@inktank.com>2013-05-02 06:16:27 +0200
commit0fff87ec798abdb4a99f01cbb0197266bb68c5dc (patch)
tree33c853319e28ed9dd20835c1f3f066be404b50a1 /drivers
parentlibceph: distinguish page and bio requests (diff)
downloadlinux-0fff87ec798abdb4a99f01cbb0197266bb68c5dc.tar.xz
linux-0fff87ec798abdb4a99f01cbb0197266bb68c5dc.zip
libceph: separate read and write data
An osd request defines information about where data to be read should be placed as well as where data to write comes from. Currently these are represented by common fields. Keep information about data for writing separate from data to be read by splitting these into data_in and data_out fields. This is the key patch in this whole series, in that it actually identifies which osd requests generate outgoing data and which generate incoming data. It's less obvious (currently) that an osd CALL op generates both outgoing and incoming data; that's the focus of some upcoming work. This resolves: http://tracker.ceph.com/issues/4127 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/rbd.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index f189bc2909b0..3f69eb1bc656 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1398,6 +1398,7 @@ static struct ceph_osd_request *rbd_osd_req_create(
struct ceph_snap_context *snapc = NULL;
struct ceph_osd_client *osdc;
struct ceph_osd_request *osd_req;
+ struct ceph_osd_data *osd_data;
struct timespec now;
struct timespec *mtime;
u64 snap_id = CEPH_NOSNAP;
@@ -1418,6 +1419,7 @@ static struct ceph_osd_request *rbd_osd_req_create(
osd_req = ceph_osdc_alloc_request(osdc, snapc, 1, false, GFP_ATOMIC);
if (!osd_req)
return NULL; /* ENOMEM */
+ osd_data = write_request ? &osd_req->r_data_out : &osd_req->r_data_in;
rbd_assert(obj_request_type_valid(obj_request->type));
switch (obj_request->type) {
@@ -1425,16 +1427,16 @@ static struct ceph_osd_request *rbd_osd_req_create(
break; /* Nothing to do */
case OBJ_REQUEST_BIO:
rbd_assert(obj_request->bio_list != NULL);
- osd_req->r_data.type = CEPH_OSD_DATA_TYPE_BIO;
- osd_req->r_data.bio = obj_request->bio_list;
+ osd_data->type = CEPH_OSD_DATA_TYPE_BIO;
+ osd_data->bio = obj_request->bio_list;
break;
case OBJ_REQUEST_PAGES:
- osd_req->r_data.type = CEPH_OSD_DATA_TYPE_PAGES;
- osd_req->r_data.pages = obj_request->pages;
- osd_req->r_data.num_pages = obj_request->page_count;
- osd_req->r_data.alignment = offset & ~PAGE_MASK;
- osd_req->r_data.pages_from_pool = false;
- osd_req->r_data.own_pages = false;
+ osd_data->type = CEPH_OSD_DATA_TYPE_PAGES;
+ osd_data->pages = obj_request->pages;
+ osd_data->num_pages = obj_request->page_count;
+ osd_data->alignment = offset & ~PAGE_MASK;
+ osd_data->pages_from_pool = false;
+ osd_data->own_pages = false;
break;
}