Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 1 | #ifndef __FS_CEPH_MESSENGER_H |
| 2 | #define __FS_CEPH_MESSENGER_H |
| 3 | |
Kent Overstreet | f38a518 | 2013-08-07 14:30:24 -0700 | [diff] [blame] | 4 | #include <linux/blk_types.h> |
Sage Weil | c2e552e | 2009-12-07 15:55:05 -0800 | [diff] [blame] | 5 | #include <linux/kref.h> |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 6 | #include <linux/mutex.h> |
| 7 | #include <linux/net.h> |
| 8 | #include <linux/radix-tree.h> |
| 9 | #include <linux/uio.h> |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 10 | #include <linux/workqueue.h> |
Ilya Dryomov | 757856d | 2015-06-25 17:47:45 +0300 | [diff] [blame] | 11 | #include <net/net_namespace.h> |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 12 | |
David Howells | a1ce392 | 2012-10-02 18:01:25 +0100 | [diff] [blame] | 13 | #include <linux/ceph/types.h> |
| 14 | #include <linux/ceph/buffer.h> |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 15 | |
| 16 | struct ceph_msg; |
| 17 | struct ceph_connection; |
| 18 | |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 19 | /* |
| 20 | * Ceph defines these callbacks for handling connection events. |
| 21 | */ |
| 22 | struct ceph_connection_operations { |
| 23 | struct ceph_connection *(*get)(struct ceph_connection *); |
| 24 | void (*put)(struct ceph_connection *); |
| 25 | |
| 26 | /* handle an incoming message. */ |
| 27 | void (*dispatch) (struct ceph_connection *con, struct ceph_msg *m); |
| 28 | |
Sage Weil | 4e7a5dc | 2009-11-18 16:19:57 -0800 | [diff] [blame] | 29 | /* authorize an outgoing connection */ |
Alex Elder | a3530df | 2012-05-16 15:16:39 -0500 | [diff] [blame] | 30 | struct ceph_auth_handshake *(*get_authorizer) ( |
| 31 | struct ceph_connection *con, |
Alex Elder | 8f43fb5 | 2012-05-16 15:16:39 -0500 | [diff] [blame] | 32 | int *proto, int force_new); |
Sage Weil | 4e7a5dc | 2009-11-18 16:19:57 -0800 | [diff] [blame] | 33 | int (*verify_authorizer_reply) (struct ceph_connection *con, int len); |
Sage Weil | 9bd2e6f | 2010-02-02 16:21:06 -0800 | [diff] [blame] | 34 | int (*invalidate_authorizer)(struct ceph_connection *con); |
Sage Weil | 4e7a5dc | 2009-11-18 16:19:57 -0800 | [diff] [blame] | 35 | |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 36 | /* there was some error on the socket (disconnect, whatever) */ |
| 37 | void (*fault) (struct ceph_connection *con); |
| 38 | |
| 39 | /* a remote host as terminated a message exchange session, and messages |
| 40 | * we sent (or they tried to send us) may be lost. */ |
| 41 | void (*peer_reset) (struct ceph_connection *con); |
| 42 | |
| 43 | struct ceph_msg * (*alloc_msg) (struct ceph_connection *con, |
Yehuda Sadeh | 2450418 | 2010-01-08 13:58:34 -0800 | [diff] [blame] | 44 | struct ceph_msg_header *hdr, |
| 45 | int *skip); |
Yan, Zheng | 33d0733 | 2014-11-04 16:33:37 +0800 | [diff] [blame] | 46 | int (*sign_message) (struct ceph_connection *con, struct ceph_msg *msg); |
| 47 | |
| 48 | int (*check_message_signature) (struct ceph_connection *con, |
| 49 | struct ceph_msg *msg); |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 50 | }; |
| 51 | |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 52 | /* use format string %s%d */ |
Sage Weil | ca9d93a | 2010-05-12 14:48:20 -0700 | [diff] [blame] | 53 | #define ENTITY_NAME(n) ceph_entity_type_name((n).type), le64_to_cpu((n).num) |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 54 | |
| 55 | struct ceph_messenger { |
| 56 | struct ceph_entity_inst inst; /* my name+address */ |
Sage Weil | 63f2d21 | 2009-11-03 15:17:56 -0800 | [diff] [blame] | 57 | struct ceph_entity_addr my_enc_addr; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 58 | |
Guanjun He | a2a3258 | 2012-07-08 19:50:33 -0700 | [diff] [blame] | 59 | atomic_t stopping; |
Ilya Dryomov | 757856d | 2015-06-25 17:47:45 +0300 | [diff] [blame] | 60 | possible_net_t net; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 61 | bool nocrc; |
Chaitanya Huilgol | ba988f8 | 2015-01-23 16:41:25 +0530 | [diff] [blame] | 62 | bool tcp_nodelay; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 63 | |
| 64 | /* |
| 65 | * the global_seq counts connections i (attempt to) initiate |
| 66 | * in order to disambiguate certain connect race conditions. |
| 67 | */ |
| 68 | u32 global_seq; |
| 69 | spinlock_t global_seq_lock; |
Yehuda Sadeh | 3d14c5d | 2010-04-06 15:14:15 -0700 | [diff] [blame] | 70 | |
Ilya Dryomov | 12b4629 | 2013-12-24 21:19:23 +0200 | [diff] [blame] | 71 | u64 supported_features; |
| 72 | u64 required_features; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 73 | }; |
| 74 | |
Alex Elder | 4379450 | 2013-03-01 18:00:16 -0600 | [diff] [blame] | 75 | enum ceph_msg_data_type { |
| 76 | CEPH_MSG_DATA_NONE, /* message contains no data payload */ |
| 77 | CEPH_MSG_DATA_PAGES, /* data source/destination is a page array */ |
| 78 | CEPH_MSG_DATA_PAGELIST, /* data source/destination is a pagelist */ |
| 79 | #ifdef CONFIG_BLOCK |
| 80 | CEPH_MSG_DATA_BIO, /* data source/destination is a bio list */ |
| 81 | #endif /* CONFIG_BLOCK */ |
| 82 | }; |
| 83 | |
| 84 | static __inline__ bool ceph_msg_data_type_valid(enum ceph_msg_data_type type) |
| 85 | { |
| 86 | switch (type) { |
| 87 | case CEPH_MSG_DATA_NONE: |
| 88 | case CEPH_MSG_DATA_PAGES: |
| 89 | case CEPH_MSG_DATA_PAGELIST: |
| 90 | #ifdef CONFIG_BLOCK |
| 91 | case CEPH_MSG_DATA_BIO: |
| 92 | #endif /* CONFIG_BLOCK */ |
| 93 | return true; |
| 94 | default: |
| 95 | return false; |
| 96 | } |
| 97 | } |
| 98 | |
Alex Elder | 36153ec | 2013-03-14 14:09:06 -0500 | [diff] [blame] | 99 | struct ceph_msg_data { |
Alex Elder | 5240d9f | 2013-03-14 14:09:06 -0500 | [diff] [blame] | 100 | struct list_head links; /* ceph_msg->data */ |
Alex Elder | 36153ec | 2013-03-14 14:09:06 -0500 | [diff] [blame] | 101 | enum ceph_msg_data_type type; |
| 102 | union { |
| 103 | #ifdef CONFIG_BLOCK |
| 104 | struct { |
| 105 | struct bio *bio; |
| 106 | size_t bio_length; |
| 107 | }; |
| 108 | #endif /* CONFIG_BLOCK */ |
| 109 | struct { |
| 110 | struct page **pages; /* NOT OWNER. */ |
| 111 | size_t length; /* total # bytes */ |
| 112 | unsigned int alignment; /* first page */ |
| 113 | }; |
| 114 | struct ceph_pagelist *pagelist; |
| 115 | }; |
Alex Elder | 36153ec | 2013-03-14 14:09:06 -0500 | [diff] [blame] | 116 | }; |
| 117 | |
Alex Elder | fe38a2b | 2013-03-06 23:39:39 -0600 | [diff] [blame] | 118 | struct ceph_msg_data_cursor { |
Alex Elder | ca8b3a6 | 2013-04-05 14:46:01 -0500 | [diff] [blame] | 119 | size_t total_resid; /* across all data items */ |
| 120 | struct list_head *data_head; /* = &ceph_msg->data */ |
| 121 | |
| 122 | struct ceph_msg_data *data; /* current data item */ |
Alex Elder | 8ae4f4f | 2013-03-14 14:09:06 -0500 | [diff] [blame] | 123 | size_t resid; /* bytes not yet consumed */ |
| 124 | bool last_piece; /* current is last piece */ |
| 125 | bool need_crc; /* crc update needed */ |
Alex Elder | dd236fc | 2013-03-06 23:39:39 -0600 | [diff] [blame] | 126 | union { |
Alex Elder | 6aaa451 | 2013-03-06 23:39:39 -0600 | [diff] [blame] | 127 | #ifdef CONFIG_BLOCK |
| 128 | struct { /* bio */ |
| 129 | struct bio *bio; /* bio from list */ |
Kent Overstreet | f38a518 | 2013-08-07 14:30:24 -0700 | [diff] [blame] | 130 | struct bvec_iter bvec_iter; |
Alex Elder | 6aaa451 | 2013-03-06 23:39:39 -0600 | [diff] [blame] | 131 | }; |
| 132 | #endif /* CONFIG_BLOCK */ |
Alex Elder | e766d7b | 2013-03-07 15:38:28 -0600 | [diff] [blame] | 133 | struct { /* pages */ |
Alex Elder | e766d7b | 2013-03-07 15:38:28 -0600 | [diff] [blame] | 134 | unsigned int page_offset; /* offset in page */ |
| 135 | unsigned short page_index; /* index in array */ |
| 136 | unsigned short page_count; /* pages in array */ |
| 137 | }; |
Alex Elder | dd236fc | 2013-03-06 23:39:39 -0600 | [diff] [blame] | 138 | struct { /* pagelist */ |
| 139 | struct page *page; /* page from list */ |
| 140 | size_t offset; /* bytes from list */ |
| 141 | }; |
| 142 | }; |
Alex Elder | fe38a2b | 2013-03-06 23:39:39 -0600 | [diff] [blame] | 143 | }; |
| 144 | |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 145 | /* |
| 146 | * a single message. it contains a header (src, dest, message type, etc.), |
| 147 | * footer (crc values, mainly), a "front" message body, and possibly a |
| 148 | * data payload (stored in some number of pages). |
| 149 | */ |
| 150 | struct ceph_msg { |
| 151 | struct ceph_msg_header hdr; /* header */ |
Yan, Zheng | 33d0733 | 2014-11-04 16:33:37 +0800 | [diff] [blame] | 152 | union { |
| 153 | struct ceph_msg_footer footer; /* footer */ |
| 154 | struct ceph_msg_footer_old old_footer; /* old format footer */ |
| 155 | }; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 156 | struct kvec front; /* unaligned blobs of message */ |
| 157 | struct ceph_buffer *middle; |
Alex Elder | 02afca6 | 2013-02-14 12:16:43 -0600 | [diff] [blame] | 158 | |
Alex Elder | 36153ec | 2013-03-14 14:09:06 -0500 | [diff] [blame] | 159 | size_t data_length; |
Alex Elder | 5240d9f | 2013-03-14 14:09:06 -0500 | [diff] [blame] | 160 | struct list_head data; |
Alex Elder | 36153ec | 2013-03-14 14:09:06 -0500 | [diff] [blame] | 161 | struct ceph_msg_data_cursor cursor; |
Alex Elder | 02afca6 | 2013-02-14 12:16:43 -0600 | [diff] [blame] | 162 | |
| 163 | struct ceph_connection *con; |
| 164 | struct list_head list_head; /* links for connection lists */ |
| 165 | |
| 166 | struct kref kref; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 167 | bool more_to_follow; |
Sage Weil | e84346b | 2010-05-11 21:20:38 -0700 | [diff] [blame] | 168 | bool needs_out_seq; |
Ilya Dryomov | 3cea4c3 | 2014-01-09 20:08:21 +0200 | [diff] [blame] | 169 | int front_alloc_len; |
Sage Weil | 4cf9d54 | 2011-07-26 11:27:24 -0700 | [diff] [blame] | 170 | unsigned long ack_stamp; /* tx: when we were acked */ |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 171 | |
| 172 | struct ceph_msgpool *pool; |
| 173 | }; |
| 174 | |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 175 | /* ceph connection fault delay defaults, for exponential backoff */ |
| 176 | #define BASE_DELAY_INTERVAL (HZ/2) |
| 177 | #define MAX_DELAY_INTERVAL (5 * 60 * HZ) |
| 178 | |
| 179 | /* |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 180 | * A single connection with another host. |
| 181 | * |
| 182 | * We maintain a queue of outgoing messages, and some session state to |
| 183 | * ensure that we can preserve the lossless, ordered delivery of |
| 184 | * messages in the case of a TCP disconnect. |
| 185 | */ |
| 186 | struct ceph_connection { |
| 187 | void *private; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 188 | |
| 189 | const struct ceph_connection_operations *ops; |
| 190 | |
| 191 | struct ceph_messenger *msgr; |
Alex Elder | ce2c890 | 2012-05-22 22:15:49 -0500 | [diff] [blame] | 192 | |
| 193 | atomic_t sock_state; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 194 | struct socket *sock; |
Alex Elder | ce2c890 | 2012-05-22 22:15:49 -0500 | [diff] [blame] | 195 | struct ceph_entity_addr peer_addr; /* peer address */ |
| 196 | struct ceph_entity_addr peer_addr_for_me; |
| 197 | |
Alex Elder | 928443c | 2012-05-22 11:41:43 -0500 | [diff] [blame] | 198 | unsigned long flags; |
| 199 | unsigned long state; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 200 | const char *error_msg; /* error message, if any */ |
| 201 | |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 202 | struct ceph_entity_name peer_name; /* peer name */ |
Alex Elder | ce2c890 | 2012-05-22 22:15:49 -0500 | [diff] [blame] | 203 | |
Ilya Dryomov | 12b4629 | 2013-12-24 21:19:23 +0200 | [diff] [blame] | 204 | u64 peer_features; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 205 | u32 connect_seq; /* identify the most recent connection |
| 206 | attempt for this connection, client */ |
| 207 | u32 peer_global_seq; /* peer's global seq for this connection */ |
| 208 | |
Sage Weil | 4e7a5dc | 2009-11-18 16:19:57 -0800 | [diff] [blame] | 209 | int auth_retry; /* true if we need a newer authorizer */ |
| 210 | void *auth_reply_buf; /* where to put the authorizer reply */ |
| 211 | int auth_reply_buf_len; |
| 212 | |
Sage Weil | ec30264 | 2009-12-22 10:43:42 -0800 | [diff] [blame] | 213 | struct mutex mutex; |
| 214 | |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 215 | /* out queue */ |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 216 | struct list_head out_queue; |
| 217 | struct list_head out_sent; /* sending or sent but unacked */ |
| 218 | u64 out_seq; /* last message queued for send */ |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 219 | |
| 220 | u64 in_seq, in_seq_acked; /* last message received, acked */ |
| 221 | |
| 222 | /* connection negotiation temps */ |
| 223 | char in_banner[CEPH_BANNER_MAX_LEN]; |
Sage Weil | a16cb1f | 2012-07-10 11:53:34 -0700 | [diff] [blame] | 224 | struct ceph_msg_connect out_connect; |
| 225 | struct ceph_msg_connect_reply in_reply; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 226 | struct ceph_entity_addr actual_peer_addr; |
| 227 | |
| 228 | /* message out temps */ |
| 229 | struct ceph_msg *out_msg; /* sending message (== tail of |
| 230 | out_sent) */ |
Sage Weil | c86a293 | 2009-12-14 14:04:30 -0800 | [diff] [blame] | 231 | bool out_msg_done; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 232 | |
| 233 | struct kvec out_kvec[8], /* sending header/footer data */ |
| 234 | *out_kvec_cur; |
| 235 | int out_kvec_left; /* kvec's left in out_kvec */ |
| 236 | int out_skip; /* skip this many bytes */ |
| 237 | int out_kvec_bytes; /* total bytes left */ |
| 238 | bool out_kvec_is_msg; /* kvec refers to out_msg */ |
| 239 | int out_more; /* there is more data after the kvecs */ |
| 240 | __le64 out_temp_ack; /* for writing an ack */ |
| 241 | |
| 242 | /* message in temps */ |
| 243 | struct ceph_msg_header in_hdr; |
| 244 | struct ceph_msg *in_msg; |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 245 | u32 in_front_crc, in_middle_crc, in_data_crc; /* calculated crc */ |
| 246 | |
| 247 | char in_tag; /* protocol control byte */ |
| 248 | int in_base_pos; /* bytes read */ |
| 249 | __le64 in_temp_ack; /* for reading an ack */ |
| 250 | |
| 251 | struct delayed_work work; /* send|recv work */ |
| 252 | unsigned long delay; /* current delay interval */ |
| 253 | }; |
| 254 | |
| 255 | |
Yehuda Sadeh | 3d14c5d | 2010-04-06 15:14:15 -0700 | [diff] [blame] | 256 | extern const char *ceph_pr_addr(const struct sockaddr_storage *ss); |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 257 | extern int ceph_parse_ips(const char *c, const char *end, |
| 258 | struct ceph_entity_addr *addr, |
| 259 | int max_count, int *count); |
| 260 | |
| 261 | |
| 262 | extern int ceph_msgr_init(void); |
| 263 | extern void ceph_msgr_exit(void); |
Sage Weil | a922d38 | 2010-05-29 09:41:23 -0700 | [diff] [blame] | 264 | extern void ceph_msgr_flush(void); |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 265 | |
Alex Elder | 15d9882 | 2012-05-26 23:26:43 -0500 | [diff] [blame] | 266 | extern void ceph_messenger_init(struct ceph_messenger *msgr, |
| 267 | struct ceph_entity_addr *myaddr, |
Ilya Dryomov | 12b4629 | 2013-12-24 21:19:23 +0200 | [diff] [blame] | 268 | u64 supported_features, |
| 269 | u64 required_features, |
Chaitanya Huilgol | ba988f8 | 2015-01-23 16:41:25 +0530 | [diff] [blame] | 270 | bool nocrc, |
| 271 | bool tcp_nodelay); |
Ilya Dryomov | 757856d | 2015-06-25 17:47:45 +0300 | [diff] [blame] | 272 | extern void ceph_messenger_fini(struct ceph_messenger *msgr); |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 273 | |
Alex Elder | 1bfd89f | 2012-05-26 23:26:43 -0500 | [diff] [blame] | 274 | extern void ceph_con_init(struct ceph_connection *con, void *private, |
| 275 | const struct ceph_connection_operations *ops, |
Sage Weil | b7a9e5d | 2012-06-27 12:24:08 -0700 | [diff] [blame] | 276 | struct ceph_messenger *msgr); |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 277 | extern void ceph_con_open(struct ceph_connection *con, |
Sage Weil | b7a9e5d | 2012-06-27 12:24:08 -0700 | [diff] [blame] | 278 | __u8 entity_type, __u64 entity_num, |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 279 | struct ceph_entity_addr *addr); |
Sage Weil | 87b315a | 2010-03-22 14:51:18 -0700 | [diff] [blame] | 280 | extern bool ceph_con_opened(struct ceph_connection *con); |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 281 | extern void ceph_con_close(struct ceph_connection *con); |
| 282 | extern void ceph_con_send(struct ceph_connection *con, struct ceph_msg *msg); |
Alex Elder | 6740a84 | 2012-06-01 14:56:43 -0500 | [diff] [blame] | 283 | |
| 284 | extern void ceph_msg_revoke(struct ceph_msg *msg); |
Alex Elder | 8921d11 | 2012-06-01 14:56:43 -0500 | [diff] [blame] | 285 | extern void ceph_msg_revoke_incoming(struct ceph_msg *msg); |
| 286 | |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 287 | extern void ceph_con_keepalive(struct ceph_connection *con); |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 288 | |
Alex Elder | 90af360 | 2013-04-05 14:46:01 -0500 | [diff] [blame] | 289 | extern void ceph_msg_data_add_pages(struct ceph_msg *msg, struct page **pages, |
Alex Elder | f1baeb2 | 2013-03-07 15:38:26 -0600 | [diff] [blame] | 290 | size_t length, size_t alignment); |
Alex Elder | 90af360 | 2013-04-05 14:46:01 -0500 | [diff] [blame] | 291 | extern void ceph_msg_data_add_pagelist(struct ceph_msg *msg, |
Alex Elder | 27fa838 | 2013-02-14 12:16:43 -0600 | [diff] [blame] | 292 | struct ceph_pagelist *pagelist); |
Alex Elder | ea96571 | 2013-04-05 14:46:01 -0500 | [diff] [blame] | 293 | #ifdef CONFIG_BLOCK |
Alex Elder | 90af360 | 2013-04-05 14:46:01 -0500 | [diff] [blame] | 294 | extern void ceph_msg_data_add_bio(struct ceph_msg *msg, struct bio *bio, |
Alex Elder | a193080 | 2013-03-14 14:09:06 -0500 | [diff] [blame] | 295 | size_t length); |
Alex Elder | ea96571 | 2013-04-05 14:46:01 -0500 | [diff] [blame] | 296 | #endif /* CONFIG_BLOCK */ |
Alex Elder | 02afca6 | 2013-02-14 12:16:43 -0600 | [diff] [blame] | 297 | |
Sage Weil | b61c276 | 2011-08-09 15:03:46 -0700 | [diff] [blame] | 298 | extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags, |
| 299 | bool can_fail); |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 300 | |
Ilya Dryomov | 0215e44 | 2014-06-20 14:14:41 +0400 | [diff] [blame] | 301 | extern struct ceph_msg *ceph_msg_get(struct ceph_msg *msg); |
| 302 | extern void ceph_msg_put(struct ceph_msg *msg); |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 303 | |
Sage Weil | 9ec7cab | 2009-12-14 15:13:47 -0800 | [diff] [blame] | 304 | extern void ceph_msg_dump(struct ceph_msg *msg); |
| 305 | |
Sage Weil | 31b8006 | 2009-10-06 11:31:13 -0700 | [diff] [blame] | 306 | #endif |