]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
libceph: record length of bio list with bio
authorAlex Elder <elder@inktank.com>
Thu, 14 Mar 2013 19:09:06 +0000 (14:09 -0500)
committerAlex Elder <elder@inktank.com>
Fri, 5 Apr 2013 12:10:13 +0000 (07:10 -0500)
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>
drivers/block/rbd.c
include/linux/ceph/osd_client.h

index 02d821ec2203cdcd8d7b55b27683a49a60e8e3ac..9fb51b53478fbfe6b32b0382ddbaa40bfbd1fe95 100644 (file)
@@ -1352,6 +1352,7 @@ static struct ceph_osd_request *rbd_osd_req_create(
                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;
                break;
        case OBJ_REQUEST_PAGES:
                osd_data->type = CEPH_OSD_DATA_TYPE_PAGES;
index 3b5ba31c2cbd17d28a7bd59c6e3134f1b6a43f90..fdda93ebbb4c622691ac58babf18c8dc0b978406 100644 (file)
@@ -71,7 +71,10 @@ struct ceph_osd_data {
                };
                struct ceph_pagelist    *pagelist;
 #ifdef CONFIG_BLOCK
-               struct bio              *bio;
+               struct {
+                       struct bio      *bio;           /* list of bios */
+                       size_t          bio_length;     /* total in list */
+               };
 #endif /* CONFIG_BLOCK */
        };
 };