• Home
  • Raw
  • Download

Lines Matching refs:msg

513 	struct msghdr msg = { .msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL };  in ceph_tcp_recvmsg()  local
517 msg.msg_flags |= MSG_TRUNC; in ceph_tcp_recvmsg()
519 iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, len); in ceph_tcp_recvmsg()
520 r = sock_recvmsg(sock, &msg, msg.msg_flags); in ceph_tcp_recvmsg()
534 struct msghdr msg = { .msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL }; in ceph_tcp_recvpage() local
538 iov_iter_bvec(&msg.msg_iter, READ, &bvec, 1, length); in ceph_tcp_recvpage()
539 r = sock_recvmsg(sock, &msg, msg.msg_flags); in ceph_tcp_recvpage()
552 struct msghdr msg = { .msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL }; in ceph_tcp_sendmsg() local
556 msg.msg_flags |= MSG_MORE; in ceph_tcp_sendmsg()
558 msg.msg_flags |= MSG_EOR; /* superfluous, but what the hell */ in ceph_tcp_sendmsg()
560 r = kernel_sendmsg(sock, &msg, iov, kvlen, len); in ceph_tcp_sendmsg()
627 static void ceph_msg_remove(struct ceph_msg *msg) in ceph_msg_remove() argument
629 list_del_init(&msg->list_head); in ceph_msg_remove()
631 ceph_msg_put(msg); in ceph_msg_remove()
636 struct ceph_msg *msg = list_first_entry(head, struct ceph_msg, in ceph_msg_remove_list() local
638 ceph_msg_remove(msg); in ceph_msg_remove_list()
1123 static void ceph_msg_data_cursor_init(struct ceph_msg *msg, size_t length) in ceph_msg_data_cursor_init() argument
1125 struct ceph_msg_data_cursor *cursor = &msg->cursor; in ceph_msg_data_cursor_init()
1128 BUG_ON(length > msg->data_length); in ceph_msg_data_cursor_init()
1129 BUG_ON(!msg->num_data_items); in ceph_msg_data_cursor_init()
1132 cursor->data = msg->data; in ceph_msg_data_cursor_init()
1227 static void prepare_message_data(struct ceph_msg *msg, u32 data_len) in prepare_message_data() argument
1231 ceph_msg_data_cursor_init(msg, (size_t)data_len); in prepare_message_data()
1561 struct ceph_msg *msg = con->out_msg; in write_partial_message_data() local
1562 struct ceph_msg_data_cursor *cursor = &msg->cursor; in write_partial_message_data()
1567 dout("%s %p msg %p\n", __func__, con, msg); in write_partial_message_data()
1569 if (!msg->num_data_items) in write_partial_message_data()
1580 crc = do_datacrc ? le32_to_cpu(msg->footer.data_crc) : 0; in write_partial_message_data()
1599 msg->footer.data_crc = cpu_to_le32(crc); in write_partial_message_data()
1608 dout("%s %p msg %p done\n", __func__, con, msg); in write_partial_message_data()
1612 msg->footer.data_crc = cpu_to_le32(crc); in write_partial_message_data()
1614 msg->footer.flags |= CEPH_MSG_FOOTER_NOCRC; in write_partial_message_data()
2321 struct ceph_msg *msg = con->in_msg; in read_partial_msg_data() local
2322 struct ceph_msg_data_cursor *cursor = &msg->cursor; in read_partial_msg_data()
2330 if (!msg->num_data_items) in read_partial_msg_data()
2528 struct ceph_msg *msg = con->in_msg; in process_message() local
2535 con->peer_name = msg->hdr.src; in process_message()
2541 msg, le64_to_cpu(msg->hdr.seq), in process_message()
2542 ENTITY_NAME(msg->hdr.src), in process_message()
2543 le16_to_cpu(msg->hdr.type), in process_message()
2544 ceph_msg_type_name(le16_to_cpu(msg->hdr.type)), in process_message()
2545 le32_to_cpu(msg->hdr.front_len), in process_message()
2546 le32_to_cpu(msg->hdr.data_len), in process_message()
2548 con->ops->dispatch(con, msg); in process_message()
3070 static void msg_con_set(struct ceph_msg *msg, struct ceph_connection *con) in msg_con_set() argument
3072 if (msg->con) in msg_con_set()
3073 msg->con->ops->put(msg->con); in msg_con_set()
3075 msg->con = con ? con->ops->get(con) : NULL; in msg_con_set()
3076 BUG_ON(msg->con != con); in msg_con_set()
3094 void ceph_con_send(struct ceph_connection *con, struct ceph_msg *msg) in ceph_con_send() argument
3097 msg->hdr.src = con->msgr->inst.name; in ceph_con_send()
3098 BUG_ON(msg->front.iov_len != le32_to_cpu(msg->hdr.front_len)); in ceph_con_send()
3099 msg->needs_out_seq = true; in ceph_con_send()
3104 dout("con_send %p closed, dropping %p\n", con, msg); in ceph_con_send()
3105 ceph_msg_put(msg); in ceph_con_send()
3110 msg_con_set(msg, con); in ceph_con_send()
3112 BUG_ON(!list_empty(&msg->list_head)); in ceph_con_send()
3113 list_add_tail(&msg->list_head, &con->out_queue); in ceph_con_send()
3114 dout("----- %p to %s%lld %d=%s len %d+%d+%d -----\n", msg, in ceph_con_send()
3115 ENTITY_NAME(con->peer_name), le16_to_cpu(msg->hdr.type), in ceph_con_send()
3116 ceph_msg_type_name(le16_to_cpu(msg->hdr.type)), in ceph_con_send()
3117 le32_to_cpu(msg->hdr.front_len), in ceph_con_send()
3118 le32_to_cpu(msg->hdr.middle_len), in ceph_con_send()
3119 le32_to_cpu(msg->hdr.data_len)); in ceph_con_send()
3134 void ceph_msg_revoke(struct ceph_msg *msg) in ceph_msg_revoke() argument
3136 struct ceph_connection *con = msg->con; in ceph_msg_revoke()
3139 dout("%s msg %p null con\n", __func__, msg); in ceph_msg_revoke()
3144 if (!list_empty(&msg->list_head)) { in ceph_msg_revoke()
3145 dout("%s %p msg %p - was on queue\n", __func__, con, msg); in ceph_msg_revoke()
3146 list_del_init(&msg->list_head); in ceph_msg_revoke()
3147 msg->hdr.seq = 0; in ceph_msg_revoke()
3149 ceph_msg_put(msg); in ceph_msg_revoke()
3151 if (con->out_msg == msg) { in ceph_msg_revoke()
3157 BUG_ON(!msg->data_length); in ceph_msg_revoke()
3161 if (msg->data_length) in ceph_msg_revoke()
3162 con->out_skip += msg->cursor.total_resid; in ceph_msg_revoke()
3163 if (msg->middle) in ceph_msg_revoke()
3168 __func__, con, msg, con->out_kvec_bytes, con->out_skip); in ceph_msg_revoke()
3169 msg->hdr.seq = 0; in ceph_msg_revoke()
3171 ceph_msg_put(msg); in ceph_msg_revoke()
3180 void ceph_msg_revoke_incoming(struct ceph_msg *msg) in ceph_msg_revoke_incoming() argument
3182 struct ceph_connection *con = msg->con; in ceph_msg_revoke_incoming()
3185 dout("%s msg %p null con\n", __func__, msg); in ceph_msg_revoke_incoming()
3190 if (con->in_msg == msg) { in ceph_msg_revoke_incoming()
3196 dout("%s %p msg %p revoked\n", __func__, con, msg); in ceph_msg_revoke_incoming()
3209 __func__, con, con->in_msg, msg); in ceph_msg_revoke_incoming()
3245 static struct ceph_msg_data *ceph_msg_data_add(struct ceph_msg *msg) in ceph_msg_data_add() argument
3247 BUG_ON(msg->num_data_items >= msg->max_data_items); in ceph_msg_data_add()
3248 return &msg->data[msg->num_data_items++]; in ceph_msg_data_add()
3257 void ceph_msg_data_add_pages(struct ceph_msg *msg, struct page **pages, in ceph_msg_data_add_pages() argument
3265 data = ceph_msg_data_add(msg); in ceph_msg_data_add_pages()
3271 msg->data_length += length; in ceph_msg_data_add_pages()
3275 void ceph_msg_data_add_pagelist(struct ceph_msg *msg, in ceph_msg_data_add_pagelist() argument
3283 data = ceph_msg_data_add(msg); in ceph_msg_data_add_pagelist()
3288 msg->data_length += pagelist->length; in ceph_msg_data_add_pagelist()
3293 void ceph_msg_data_add_bio(struct ceph_msg *msg, struct ceph_bio_iter *bio_pos, in ceph_msg_data_add_bio() argument
3298 data = ceph_msg_data_add(msg); in ceph_msg_data_add_bio()
3303 msg->data_length += length; in ceph_msg_data_add_bio()
3308 void ceph_msg_data_add_bvecs(struct ceph_msg *msg, in ceph_msg_data_add_bvecs() argument
3313 data = ceph_msg_data_add(msg); in ceph_msg_data_add_bvecs()
3317 msg->data_length += bvec_pos->iter.bi_size; in ceph_msg_data_add_bvecs()
3395 static int ceph_alloc_middle(struct ceph_connection *con, struct ceph_msg *msg) in ceph_alloc_middle() argument
3397 int type = le16_to_cpu(msg->hdr.type); in ceph_alloc_middle()
3398 int middle_len = le32_to_cpu(msg->hdr.middle_len); in ceph_alloc_middle()
3400 dout("alloc_middle %p type %d %s middle_len %d\n", msg, type, in ceph_alloc_middle()
3403 BUG_ON(msg->middle); in ceph_alloc_middle()
3405 msg->middle = ceph_buffer_new(middle_len, GFP_NOFS); in ceph_alloc_middle()
3406 if (!msg->middle) in ceph_alloc_middle()
3430 struct ceph_msg *msg; in ceph_con_in_msg_alloc() local
3437 msg = con->ops->alloc_msg(con, hdr, skip); in ceph_con_in_msg_alloc()
3440 if (msg) in ceph_con_in_msg_alloc()
3441 ceph_msg_put(msg); in ceph_con_in_msg_alloc()
3444 if (msg) { in ceph_con_in_msg_alloc()
3446 msg_con_set(msg, con); in ceph_con_in_msg_alloc()
3447 con->in_msg = msg; in ceph_con_in_msg_alloc()
3510 struct ceph_msg *ceph_msg_get(struct ceph_msg *msg) in ceph_msg_get() argument
3512 dout("%s %p (was %d)\n", __func__, msg, in ceph_msg_get()
3513 kref_read(&msg->kref)); in ceph_msg_get()
3514 kref_get(&msg->kref); in ceph_msg_get()
3515 return msg; in ceph_msg_get()
3519 void ceph_msg_put(struct ceph_msg *msg) in ceph_msg_put() argument
3521 dout("%s %p (was %d)\n", __func__, msg, in ceph_msg_put()
3522 kref_read(&msg->kref)); in ceph_msg_put()
3523 kref_put(&msg->kref, ceph_msg_release); in ceph_msg_put()
3527 void ceph_msg_dump(struct ceph_msg *msg) in ceph_msg_dump() argument
3529 pr_debug("msg_dump %p (front_alloc_len %d length %zd)\n", msg, in ceph_msg_dump()
3530 msg->front_alloc_len, msg->data_length); in ceph_msg_dump()
3533 &msg->hdr, sizeof(msg->hdr), true); in ceph_msg_dump()
3536 msg->front.iov_base, msg->front.iov_len, true); in ceph_msg_dump()
3537 if (msg->middle) in ceph_msg_dump()
3540 msg->middle->vec.iov_base, in ceph_msg_dump()
3541 msg->middle->vec.iov_len, true); in ceph_msg_dump()
3544 &msg->footer, sizeof(msg->footer), true); in ceph_msg_dump()