aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-12 00:34:24 -0400
committerSage Weil <sage@inktank.com>2013-05-02 00:17:37 -0400
commit6644ed7b7e04f8e588aebdaa58cededb9416ab95 (patch)
tree2770308c0a48245b81754238f0c37e87605fde3b /include/linux
parent8ea299bcbc85aeaf5348d99614b35433287bec6b (diff)
libceph: make message data be a pointer
Begin the transition from a single message data item to a list of them by replacing the "data" structure in a message with a pointer to a ceph_msg_data structure. A null pointer will indicate the message has no data; replace the use of ceph_msg_has_data() with a simple check for a null pointer. Create functions ceph_msg_data_create() and ceph_msg_data_destroy() to dynamically allocate and free a data item structure of a given type. When a message has its data item "set," allocate one of these to hold the data description, and free it when the last reference to the message is dropped. This partially resolves: http://tracker.ceph.com/issues/4429 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ceph/messenger.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 686df5bfa717..3181321bed6d 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -64,8 +64,6 @@ struct ceph_messenger {
64 u32 required_features; 64 u32 required_features;
65}; 65};
66 66
67#define ceph_msg_has_data(m) ((m)->data.type != CEPH_MSG_DATA_NONE)
68
69enum ceph_msg_data_type { 67enum ceph_msg_data_type {
70 CEPH_MSG_DATA_NONE, /* message contains no data payload */ 68 CEPH_MSG_DATA_NONE, /* message contains no data payload */
71 CEPH_MSG_DATA_PAGES, /* data source/destination is a page array */ 69 CEPH_MSG_DATA_PAGES, /* data source/destination is a page array */
@@ -141,8 +139,7 @@ struct ceph_msg {
141 struct kvec front; /* unaligned blobs of message */ 139 struct kvec front; /* unaligned blobs of message */
142 struct ceph_buffer *middle; 140 struct ceph_buffer *middle;
143 141
144 /* data payload */ 142 struct ceph_msg_data *data; /* data payload */
145 struct ceph_msg_data data;
146 143
147 struct ceph_connection *con; 144 struct ceph_connection *con;
148 struct list_head list_head; /* links for connection lists */ 145 struct list_head list_head; /* links for connection lists */