}
}
+struct ceph_msg_data {
+ struct list_head links; /* ceph_msg->data */
+ enum ceph_msg_data_type type;
+ union {
+#ifdef CONFIG_BLOCK
+ struct {
+ struct bio *bio;
+ size_t bio_length;
+ };
+#endif /* CONFIG_BLOCK */
+ struct {
+ struct page **pages; /* NOT OWNER. */
+ size_t length; /* total # bytes */
+ unsigned int alignment; /* first page */
+ };
+ struct ceph_pagelist *pagelist;
+ };
+};
+
struct ceph_msg_data_cursor {
- size_t resid; /* bytes not yet consumed */
- bool last_piece; /* now at last piece of data item */
- bool need_crc; /* new piece; crc update needed */
+ size_t total_resid; /* across all data items */
+ struct list_head *data_head; /* = &ceph_msg->data */
+
+ struct ceph_msg_data *data; /* current data item */
+ size_t resid; /* bytes not yet consumed */
+ bool last_piece; /* current is last piece */
+ bool need_crc; /* crc update needed */
union {
#ifdef CONFIG_BLOCK
struct { /* bio */
};
};
-struct ceph_msg_data {
- enum ceph_msg_data_type type;
- union {
-#ifdef CONFIG_BLOCK
- struct {
- struct bio *bio;
- size_t bio_length;
- };
-#endif /* CONFIG_BLOCK */
- struct {
- struct page **pages; /* NOT OWNER. */
- size_t length; /* total # bytes */
- unsigned int alignment; /* first page */
- };
- struct ceph_pagelist *pagelist;
- };
- struct ceph_msg_data_cursor cursor; /* pagelist only */
-};
-
/*
* a single message. it contains a header (src, dest, message type, etc.),
* footer (crc values, mainly), a "front" message body, and possibly a
struct kvec front; /* unaligned blobs of message */
struct ceph_buffer *middle;
- size_t data_length;
- struct ceph_msg_data *data; /* data payload */
+ size_t data_length;
+ struct list_head data;
+ struct ceph_msg_data_cursor cursor;
struct ceph_connection *con;
struct list_head list_head; /* links for connection lists */
extern void ceph_con_keepalive(struct ceph_connection *con);
-extern void ceph_msg_data_set_pages(struct ceph_msg *msg, struct page **pages,
+extern void ceph_msg_data_add_pages(struct ceph_msg *msg, struct page **pages,
size_t length, size_t alignment);
-extern void ceph_msg_data_set_pagelist(struct ceph_msg *msg,
+extern void ceph_msg_data_add_pagelist(struct ceph_msg *msg,
struct ceph_pagelist *pagelist);
#ifdef CONFIG_BLOCK
-extern void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio,
+extern void ceph_msg_data_add_bio(struct ceph_msg *msg, struct bio *bio,
size_t length);
#endif /* CONFIG_BLOCK */