diff options
author | Alex Elder <elder@inktank.com> | 2013-03-12 00:34:23 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:17:34 -0400 |
commit | f5db90bcf2c69d099f9d828a8104796f41de6bc5 (patch) | |
tree | e0f5e2c76beeea42d41c47f5ebb9b8130bf8a171 /include/linux/ceph/messenger.h | |
parent | 859a35d5523e8e6a5c3568c12febe2e1270bc3a1 (diff) |
libceph: kill last of ceph_msg_pos
The only remaining field in the ceph_msg_pos structure is
did_page_crc. In the new cursor model of things that flag (or
something like it) belongs in the cursor.
Define a new field "need_crc" in the cursor (which applies to all
types of data) and initialize it to true whenever a cursor is
initialized.
In write_partial_message_data(), the data CRC still will be computed
as before, but it will check the cursor->need_crc field to determine
whether it's needed. Any time the cursor is advanced to a new piece
of a data item, need_crc will be set, and this will cause the crc
for that entire piece to be accumulated into the data crc.
In write_partial_message_data() the intermediate crc value is now
held in a local variable so it doesn't have to be byte-swapped so
many times. In read_partial_msg_data() we do something similar
(but mainly for consistency there).
With that, the ceph_msg_pos structure can go away, and it no longer
needs to be passed as an argument to prepare_message_data().
This cleanup is related to:
http://tracker.ceph.com/issues/4428
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.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index c76b228cb524..686df5bfa717 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
@@ -93,6 +93,7 @@ static __inline__ bool ceph_msg_data_type_valid(enum ceph_msg_data_type type) | |||
93 | struct ceph_msg_data_cursor { | 93 | struct ceph_msg_data_cursor { |
94 | size_t resid; /* bytes not yet consumed */ | 94 | size_t resid; /* bytes not yet consumed */ |
95 | bool last_piece; /* now at last piece of data item */ | 95 | bool last_piece; /* now at last piece of data item */ |
96 | bool need_crc; /* new piece; crc update needed */ | ||
96 | union { | 97 | union { |
97 | #ifdef CONFIG_BLOCK | 98 | #ifdef CONFIG_BLOCK |
98 | struct { /* bio */ | 99 | struct { /* bio */ |
@@ -156,10 +157,6 @@ struct ceph_msg { | |||
156 | struct ceph_msgpool *pool; | 157 | struct ceph_msgpool *pool; |
157 | }; | 158 | }; |
158 | 159 | ||
159 | struct ceph_msg_pos { | ||
160 | bool did_page_crc; /* true if we've calculated crc for current page */ | ||
161 | }; | ||
162 | |||
163 | /* ceph connection fault delay defaults, for exponential backoff */ | 160 | /* ceph connection fault delay defaults, for exponential backoff */ |
164 | #define BASE_DELAY_INTERVAL (HZ/2) | 161 | #define BASE_DELAY_INTERVAL (HZ/2) |
165 | #define MAX_DELAY_INTERVAL (5 * 60 * HZ) | 162 | #define MAX_DELAY_INTERVAL (5 * 60 * HZ) |
@@ -217,7 +214,6 @@ struct ceph_connection { | |||
217 | struct ceph_msg *out_msg; /* sending message (== tail of | 214 | struct ceph_msg *out_msg; /* sending message (== tail of |
218 | out_sent) */ | 215 | out_sent) */ |
219 | bool out_msg_done; | 216 | bool out_msg_done; |
220 | struct ceph_msg_pos out_msg_pos; | ||
221 | 217 | ||
222 | struct kvec out_kvec[8], /* sending header/footer data */ | 218 | struct kvec out_kvec[8], /* sending header/footer data */ |
223 | *out_kvec_cur; | 219 | *out_kvec_cur; |
@@ -231,7 +227,6 @@ struct ceph_connection { | |||
231 | /* message in temps */ | 227 | /* message in temps */ |
232 | struct ceph_msg_header in_hdr; | 228 | struct ceph_msg_header in_hdr; |
233 | struct ceph_msg *in_msg; | 229 | struct ceph_msg *in_msg; |
234 | struct ceph_msg_pos in_msg_pos; | ||
235 | u32 in_front_crc, in_middle_crc, in_data_crc; /* calculated crc */ | 230 | u32 in_front_crc, in_middle_crc, in_data_crc; /* calculated crc */ |
236 | 231 | ||
237 | char in_tag; /* protocol control byte */ | 232 | char in_tag; /* protocol control byte */ |