Merge tag 'for-linus-20130509' of git://git.infradead.org/linux-mtd
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / ceph / messenger.h
index 4fb870a5b5fcff2f658b091ffb880c6e5ab4214a..7c1420bb1dcef40e6f8e4cc571ef5ea2c25df913 100644 (file)
@@ -88,10 +88,33 @@ static __inline__ bool ceph_msg_data_type_valid(enum ceph_msg_data_type type)
        }
 }
 
+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 */
@@ -112,25 +135,6 @@ struct ceph_msg_data_cursor {
        };
 };
 
-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
@@ -142,8 +146,9 @@ struct ceph_msg {
        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 */
@@ -270,12 +275,12 @@ extern void ceph_msg_revoke_incoming(struct ceph_msg *msg);
 
 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 */