Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdce58cc authored by Alex Elder's avatar Alex Elder Committed by Sage Weil
Browse files

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: default avatarAlex Elder <elder@inktank.com>
Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
parent ace6d3a9
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1352,6 +1352,7 @@ static struct ceph_osd_request *rbd_osd_req_create(
		rbd_assert(obj_request->bio_list != NULL);
		rbd_assert(obj_request->bio_list != NULL);
		osd_data->type = CEPH_OSD_DATA_TYPE_BIO;
		osd_data->type = CEPH_OSD_DATA_TYPE_BIO;
		osd_data->bio = obj_request->bio_list;
		osd_data->bio = obj_request->bio_list;
		osd_data->bio_length = obj_request->length;
		break;
		break;
	case OBJ_REQUEST_PAGES:
	case OBJ_REQUEST_PAGES:
		osd_data->type = CEPH_OSD_DATA_TYPE_PAGES;
		osd_data->type = CEPH_OSD_DATA_TYPE_PAGES;
+4 −1
Original line number Original line Diff line number Diff line
@@ -71,7 +71,10 @@ struct ceph_osd_data {
		};
		};
		struct ceph_pagelist	*pagelist;
		struct ceph_pagelist	*pagelist;
#ifdef CONFIG_BLOCK
#ifdef CONFIG_BLOCK
		struct bio       	*bio;
		struct {
			struct bio	*bio;		/* list of bios */
			size_t		bio_length;	/* total in list */
		};
#endif /* CONFIG_BLOCK */
#endif /* CONFIG_BLOCK */
	};
	};
};
};