libceph: record bio length
authorAlex Elder <elder@inktank.com>
Fri, 5 Apr 2013 19:46:01 +0000 (14:46 -0500)
committerSage Weil <sage@inktank.com>
Thu, 2 May 2013 04:18:28 +0000 (21:18 -0700)
The bio is the only data item type that doesn't record its full
length.  Fix that.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
include/linux/ceph/messenger.h
net/ceph/messenger.c

index cdeebae03e0d32cf2e37559211b4b6d6950daa71..4fb870a5b5fcff2f658b091ffb880c6e5ab4214a 100644 (file)
@@ -116,7 +116,10 @@ struct ceph_msg_data {
        enum ceph_msg_data_type         type;
        union {
 #ifdef CONFIG_BLOCK
-               struct bio              *bio;
+               struct {
+                       struct bio      *bio;
+                       size_t          bio_length;
+               };
 #endif /* CONFIG_BLOCK */
                struct {
                        struct page     **pages;        /* NOT OWNER. */
index cb5b4e6733f0b0027eb817c9826db71025918bc3..731bb9efa2c6dbeff2687aee1f08c16568c080a4 100644 (file)
@@ -3032,6 +3032,7 @@ void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio,
        data = ceph_msg_data_create(CEPH_MSG_DATA_BIO);
        BUG_ON(!data);
        data->bio = bio;
+       data->bio_length = length;
 
        msg->data = data;
        msg->data_length = length;