summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-04-03 01:28:57 -0500
committerSage Weil <sage@inktank.com>2013-05-01 21:18:06 -0700
commit43bfe5de9fa78e07248b70992ce50321efec622c (patch)
tree8aa7ce9ad14551bdfcb1bf166a90b65a3dab7c02 /drivers/block
parent9fc6e0647180f72392f03a29863b6602e22aa024 (diff)
libceph: define osd data initialization helpers
Define and use functions that encapsulate the initializion of a ceph_osd_data structure. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index afbc9f6f8ff1..ab21b5218ae3 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1350,17 +1350,13 @@ 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_data->type = CEPH_OSD_DATA_TYPE_BIO;
- osd_data->bio = obj_request->bio_list;
- osd_data->bio_length = obj_request->length;
+ ceph_osd_data_bio_init(osd_data, obj_request->bio_list,
+ obj_request->length);
break;
case OBJ_REQUEST_PAGES:
- osd_data->type = CEPH_OSD_DATA_TYPE_PAGES;
- osd_data->pages = obj_request->pages;
- osd_data->length = obj_request->length;
- osd_data->alignment = offset & ~PAGE_MASK;
- osd_data->pages_from_pool = false;
- osd_data->own_pages = false;
+ ceph_osd_data_pages_init(osd_data, obj_request->pages,
+ obj_request->length, offset & ~PAGE_MASK,
+ false, false);
break;
}