struct kvec front; /* unaligned blobs of message */
struct ceph_buffer *middle;
+ size_t data_length;
struct ceph_msg_data *data; /* data payload */
struct ceph_connection *con;
size_t length, size_t alignment);
extern void ceph_msg_data_set_pagelist(struct ceph_msg *msg,
struct ceph_pagelist *pagelist);
-extern void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio);
+extern void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio,
+ size_t length);
extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags,
bool can_fail);
BUG_ON(!pages);
BUG_ON(!length);
+ BUG_ON(msg->data_length);
BUG_ON(msg->data != NULL);
data = ceph_msg_data_create(CEPH_MSG_DATA_PAGES);
data->alignment = alignment & ~PAGE_MASK;
msg->data = data;
+ msg->data_length = length;
}
EXPORT_SYMBOL(ceph_msg_data_set_pages);
BUG_ON(!pagelist);
BUG_ON(!pagelist->length);
+ BUG_ON(msg->data_length);
BUG_ON(msg->data != NULL);
data = ceph_msg_data_create(CEPH_MSG_DATA_PAGELIST);
data->pagelist = pagelist;
msg->data = data;
+ msg->data_length = pagelist->length;
}
EXPORT_SYMBOL(ceph_msg_data_set_pagelist);
-void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio)
+void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio,
+ size_t length)
{
struct ceph_msg_data *data;
BUG_ON(!bio);
+ BUG_ON(msg->data_length);
BUG_ON(msg->data != NULL);
data = ceph_msg_data_create(CEPH_MSG_DATA_BIO);
data->bio = bio;
msg->data = data;
+ msg->data_length = length;
}
EXPORT_SYMBOL(ceph_msg_data_set_bio);
}
ceph_msg_data_destroy(m->data);
m->data = NULL;
+ m->data_length = 0;
if (m->pool)
ceph_msgpool_put(m->pool, m);
ceph_msg_data_set_pagelist(msg, osd_data->pagelist);
#ifdef CONFIG_BLOCK
} else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) {
- ceph_msg_data_set_bio(msg, osd_data->bio);
+ ceph_msg_data_set_bio(msg, osd_data->bio, osd_data->bio_length);
#endif
} else {
BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_NONE);