.. | .. |
---|
54 | 54 | int (*check_message_signature) (struct ceph_msg *msg); |
---|
55 | 55 | }; |
---|
56 | 56 | |
---|
57 | | -/* use format string %s%d */ |
---|
| 57 | +/* use format string %s%lld */ |
---|
58 | 58 | #define ENTITY_NAME(n) ceph_entity_type_name((n).type), le64_to_cpu((n).num) |
---|
59 | 59 | |
---|
60 | 60 | struct ceph_messenger { |
---|
.. | .. |
---|
81 | 81 | #endif /* CONFIG_BLOCK */ |
---|
82 | 82 | CEPH_MSG_DATA_BVECS, /* data source/destination is a bio_vec array */ |
---|
83 | 83 | }; |
---|
84 | | - |
---|
85 | | -static __inline__ bool ceph_msg_data_type_valid(enum ceph_msg_data_type type) |
---|
86 | | -{ |
---|
87 | | - switch (type) { |
---|
88 | | - case CEPH_MSG_DATA_NONE: |
---|
89 | | - case CEPH_MSG_DATA_PAGES: |
---|
90 | | - case CEPH_MSG_DATA_PAGELIST: |
---|
91 | | -#ifdef CONFIG_BLOCK |
---|
92 | | - case CEPH_MSG_DATA_BIO: |
---|
93 | | -#endif /* CONFIG_BLOCK */ |
---|
94 | | - case CEPH_MSG_DATA_BVECS: |
---|
95 | | - return true; |
---|
96 | | - default: |
---|
97 | | - return false; |
---|
98 | | - } |
---|
99 | | -} |
---|
100 | 84 | |
---|
101 | 85 | #ifdef CONFIG_BLOCK |
---|
102 | 86 | |
---|
.. | .. |
---|
181 | 165 | } while (0) |
---|
182 | 166 | |
---|
183 | 167 | struct ceph_msg_data { |
---|
184 | | - struct list_head links; /* ceph_msg->data */ |
---|
185 | 168 | enum ceph_msg_data_type type; |
---|
186 | 169 | union { |
---|
187 | 170 | #ifdef CONFIG_BLOCK |
---|
.. | .. |
---|
192 | 175 | #endif /* CONFIG_BLOCK */ |
---|
193 | 176 | struct ceph_bvec_iter bvec_pos; |
---|
194 | 177 | struct { |
---|
195 | | - struct page **pages; /* NOT OWNER. */ |
---|
| 178 | + struct page **pages; |
---|
196 | 179 | size_t length; /* total # bytes */ |
---|
197 | 180 | unsigned int alignment; /* first page */ |
---|
| 181 | + bool own_pages; |
---|
198 | 182 | }; |
---|
199 | 183 | struct ceph_pagelist *pagelist; |
---|
200 | 184 | }; |
---|
.. | .. |
---|
202 | 186 | |
---|
203 | 187 | struct ceph_msg_data_cursor { |
---|
204 | 188 | size_t total_resid; /* across all data items */ |
---|
205 | | - struct list_head *data_head; /* = &ceph_msg->data */ |
---|
206 | 189 | |
---|
207 | 190 | struct ceph_msg_data *data; /* current data item */ |
---|
208 | 191 | size_t resid; /* bytes not yet consumed */ |
---|
.. | .. |
---|
240 | 223 | struct ceph_buffer *middle; |
---|
241 | 224 | |
---|
242 | 225 | size_t data_length; |
---|
243 | | - struct list_head data; |
---|
| 226 | + struct ceph_msg_data *data; |
---|
| 227 | + int num_data_items; |
---|
| 228 | + int max_data_items; |
---|
244 | 229 | struct ceph_msg_data_cursor cursor; |
---|
245 | 230 | |
---|
246 | 231 | struct ceph_connection *con; |
---|
.. | .. |
---|
339 | 324 | }; |
---|
340 | 325 | |
---|
341 | 326 | |
---|
342 | | -extern const char *ceph_pr_addr(const struct sockaddr_storage *ss); |
---|
| 327 | +extern const char *ceph_pr_addr(const struct ceph_entity_addr *addr); |
---|
| 328 | + |
---|
343 | 329 | extern int ceph_parse_ips(const char *c, const char *end, |
---|
344 | 330 | struct ceph_entity_addr *addr, |
---|
345 | 331 | int max_count, int *count); |
---|
.. | .. |
---|
352 | 338 | extern void ceph_messenger_init(struct ceph_messenger *msgr, |
---|
353 | 339 | struct ceph_entity_addr *myaddr); |
---|
354 | 340 | extern void ceph_messenger_fini(struct ceph_messenger *msgr); |
---|
| 341 | +extern void ceph_messenger_reset_nonce(struct ceph_messenger *msgr); |
---|
355 | 342 | |
---|
356 | 343 | extern void ceph_con_init(struct ceph_connection *con, void *private, |
---|
357 | 344 | const struct ceph_connection_operations *ops, |
---|
.. | .. |
---|
370 | 357 | extern bool ceph_con_keepalive_expired(struct ceph_connection *con, |
---|
371 | 358 | unsigned long interval); |
---|
372 | 359 | |
---|
373 | | -extern void ceph_msg_data_add_pages(struct ceph_msg *msg, struct page **pages, |
---|
374 | | - size_t length, size_t alignment); |
---|
| 360 | +void ceph_msg_data_add_pages(struct ceph_msg *msg, struct page **pages, |
---|
| 361 | + size_t length, size_t alignment, bool own_pages); |
---|
375 | 362 | extern void ceph_msg_data_add_pagelist(struct ceph_msg *msg, |
---|
376 | 363 | struct ceph_pagelist *pagelist); |
---|
377 | 364 | #ifdef CONFIG_BLOCK |
---|
.. | .. |
---|
381 | 368 | void ceph_msg_data_add_bvecs(struct ceph_msg *msg, |
---|
382 | 369 | struct ceph_bvec_iter *bvec_pos); |
---|
383 | 370 | |
---|
| 371 | +struct ceph_msg *ceph_msg_new2(int type, int front_len, int max_data_items, |
---|
| 372 | + gfp_t flags, bool can_fail); |
---|
384 | 373 | extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags, |
---|
385 | 374 | bool can_fail); |
---|
386 | 375 | |
---|