summaryrefslogtreecommitdiff
path: root/include/linux/ceph/messenger.h
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-12 08:34:23 +0400
committerSage Weil <sage@inktank.com>2013-05-02 08:17:30 +0400
commit4c59b4a278f9b7a418ad8af933fd7b341df64393 (patch)
tree8f42d880e2ed3fb97c64ea293b42ff08f891537a /include/linux/ceph/messenger.h
parent686be20875db63c6103573565c63db20153ee6e1 (diff)
downloadlinux-4c59b4a278f9b7a418ad8af933fd7b341df64393.tar.xz
libceph: collapse all data items into one
It turns out that only one of the data item types is ever used at any one time in a single message (currently). - A page array is used by the osd client (on behalf of the file system) and by rbd. Only one osd op (and therefore at most one data item) is ever used at a time by rbd. And the only time the file system sends two, the second op contains no data. - A bio is only used by the rbd client (and again, only one data item per message) - A page list is used by the file system and by rbd for outgoing data, but only one op (and one data item) at a time. We can therefore collapse all three of our data item fields into a single field "data", and depend on the messenger code to properly handle it based on its type. This allows us to eliminate quite a bit of duplicated code. This is related to: 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/ceph/messenger.h')
-rw-r--r--include/linux/ceph/messenger.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 252e01b7f7de..af786b29f7a4 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -64,11 +64,7 @@ struct ceph_messenger {
u32 required_features;
};
-#define ceph_msg_has_pages(m) ((m)->p.type == CEPH_MSG_DATA_PAGES)
-#define ceph_msg_has_pagelist(m) ((m)->l.type == CEPH_MSG_DATA_PAGELIST)
-#ifdef CONFIG_BLOCK
-#define ceph_msg_has_bio(m) ((m)->b.type == CEPH_MSG_DATA_BIO)
-#endif /* CONFIG_BLOCK */
+#define ceph_msg_has_data(m) ((m)->data.type != CEPH_MSG_DATA_NONE)
enum ceph_msg_data_type {
CEPH_MSG_DATA_NONE, /* message contains no data payload */
@@ -145,11 +141,7 @@ struct ceph_msg {
struct ceph_buffer *middle;
/* data payload */
- struct ceph_msg_data p; /* pages */
- struct ceph_msg_data l; /* pagelist */
-#ifdef CONFIG_BLOCK
- struct ceph_msg_data b; /* bio */
-#endif /* CONFIG_BLOCK */
+ struct ceph_msg_data data;
struct ceph_connection *con;
struct list_head list_head; /* links for connection lists */