diff options
author | Alex Elder <elder@inktank.com> | 2013-04-03 08:28:57 +0200 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 06:18:06 +0200 |
commit | 43bfe5de9fa78e07248b70992ce50321efec622c (patch) | |
tree | 8aa7ce9ad14551bdfcb1bf166a90b65a3dab7c02 /drivers | |
parent | libceph: compute incoming bytes once (diff) | |
download | linux-43bfe5de9fa78e07248b70992ce50321efec622c.tar.xz linux-43bfe5de9fa78e07248b70992ce50321efec622c.zip |
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')
-rw-r--r-- | drivers/block/rbd.c | 14 |
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; } |