hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/ceph/messenger.h
....@@ -54,7 +54,7 @@
5454 int (*check_message_signature) (struct ceph_msg *msg);
5555 };
5656
57
-/* use format string %s%d */
57
+/* use format string %s%lld */
5858 #define ENTITY_NAME(n) ceph_entity_type_name((n).type), le64_to_cpu((n).num)
5959
6060 struct ceph_messenger {
....@@ -81,22 +81,6 @@
8181 #endif /* CONFIG_BLOCK */
8282 CEPH_MSG_DATA_BVECS, /* data source/destination is a bio_vec array */
8383 };
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
-}
10084
10185 #ifdef CONFIG_BLOCK
10286
....@@ -181,7 +165,6 @@
181165 } while (0)
182166
183167 struct ceph_msg_data {
184
- struct list_head links; /* ceph_msg->data */
185168 enum ceph_msg_data_type type;
186169 union {
187170 #ifdef CONFIG_BLOCK
....@@ -192,9 +175,10 @@
192175 #endif /* CONFIG_BLOCK */
193176 struct ceph_bvec_iter bvec_pos;
194177 struct {
195
- struct page **pages; /* NOT OWNER. */
178
+ struct page **pages;
196179 size_t length; /* total # bytes */
197180 unsigned int alignment; /* first page */
181
+ bool own_pages;
198182 };
199183 struct ceph_pagelist *pagelist;
200184 };
....@@ -202,7 +186,6 @@
202186
203187 struct ceph_msg_data_cursor {
204188 size_t total_resid; /* across all data items */
205
- struct list_head *data_head; /* = &ceph_msg->data */
206189
207190 struct ceph_msg_data *data; /* current data item */
208191 size_t resid; /* bytes not yet consumed */
....@@ -240,7 +223,9 @@
240223 struct ceph_buffer *middle;
241224
242225 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;
244229 struct ceph_msg_data_cursor cursor;
245230
246231 struct ceph_connection *con;
....@@ -339,7 +324,8 @@
339324 };
340325
341326
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
+
343329 extern int ceph_parse_ips(const char *c, const char *end,
344330 struct ceph_entity_addr *addr,
345331 int max_count, int *count);
....@@ -352,6 +338,7 @@
352338 extern void ceph_messenger_init(struct ceph_messenger *msgr,
353339 struct ceph_entity_addr *myaddr);
354340 extern void ceph_messenger_fini(struct ceph_messenger *msgr);
341
+extern void ceph_messenger_reset_nonce(struct ceph_messenger *msgr);
355342
356343 extern void ceph_con_init(struct ceph_connection *con, void *private,
357344 const struct ceph_connection_operations *ops,
....@@ -370,8 +357,8 @@
370357 extern bool ceph_con_keepalive_expired(struct ceph_connection *con,
371358 unsigned long interval);
372359
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);
375362 extern void ceph_msg_data_add_pagelist(struct ceph_msg *msg,
376363 struct ceph_pagelist *pagelist);
377364 #ifdef CONFIG_BLOCK
....@@ -381,6 +368,8 @@
381368 void ceph_msg_data_add_bvecs(struct ceph_msg *msg,
382369 struct ceph_bvec_iter *bvec_pos);
383370
371
+struct ceph_msg *ceph_msg_new2(int type, int front_len, int max_data_items,
372
+ gfp_t flags, bool can_fail);
384373 extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags,
385374 bool can_fail);
386375