summaryrefslogtreecommitdiffstats
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/rbd.c')
-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;
}