aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-14 15:09:06 -0400
committerSage Weil <sage@inktank.com>2013-05-02 00:17:56 -0400
commitfdce58ccb5df621695b079378c619046acabc778 (patch)
treeec1f5349bd40393ba124dc976fc122dd46428fc0
parentace6d3a96f00c271b3f337adcde8e8cbe39c3820 (diff)
libceph: record length of bio list with bio
When assigning a bio pointer to an osd request, we don't have an efficient way of knowing the total length bytes in the bio list. That information is available at the point it's set up by the rbd code, so record it with the osd data when it's set. This and the next patch are related to maintaining the length of a message's data independent of the message header, as described here: http://tracker.ceph.com/issues/4589 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r--drivers/block/rbd.c1
-rw-r--r--include/linux/ceph/osd_client.h5
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index f04d45b6b563..e95a92e89330 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1352,6 +1352,7 @@ static struct ceph_osd_request *rbd_osd_req_create(
1352 rbd_assert(obj_request->bio_list != NULL); 1352 rbd_assert(obj_request->bio_list != NULL);
1353 osd_data->type = CEPH_OSD_DATA_TYPE_BIO; 1353 osd_data->type = CEPH_OSD_DATA_TYPE_BIO;
1354 osd_data->bio = obj_request->bio_list; 1354 osd_data->bio = obj_request->bio_list;
1355 osd_data->bio_length = obj_request->length;
1355 break; 1356 break;
1356 case OBJ_REQUEST_PAGES: 1357 case OBJ_REQUEST_PAGES:
1357 osd_data->type = CEPH_OSD_DATA_TYPE_PAGES; 1358 osd_data->type = CEPH_OSD_DATA_TYPE_PAGES;
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 3b5ba31c2cbd..fdda93ebbb4c 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -71,7 +71,10 @@ struct ceph_osd_data {
71 }; 71 };
72 struct ceph_pagelist *pagelist; 72 struct ceph_pagelist *pagelist;
73#ifdef CONFIG_BLOCK 73#ifdef CONFIG_BLOCK
74 struct bio *bio; 74 struct {
75 struct bio *bio; /* list of bios */
76 size_t bio_length; /* total in list */
77 };
75#endif /* CONFIG_BLOCK */ 78#endif /* CONFIG_BLOCK */
76 }; 79 };
77}; 80};