Lines Matching +full:dout +full:- +full:default
1 // SPDX-License-Identifier: GPL-2.0
44 * --------
46 * --------
49 * ----------
51 * ---------- TCP connection)
54 * | ----------------------
57 * |+--------------------------- \
59 * | ----------- \ \
61 * | ----------- await close \ \
66 * | / --------------- | |
68 * | / --------------
69 * | / -----------------| CONNECTING | socket created, TCP
70 * | | / -------------- connect initiated
73 * -------------
75 * -------------
77 * State values for ceph_connection->sock_state; NEW is assumed to be 0.
80 #define CON_SOCK_STATE_NEW 0 /* -> CLOSED */
81 #define CON_SOCK_STATE_CLOSED 1 /* -> CONNECTING */
82 #define CON_SOCK_STATE_CONNECTING 2 /* -> CONNECTED or -> CLOSING */
83 #define CON_SOCK_STATE_CONNECTED 3 /* -> CLOSING or -> CLOSED */
84 #define CON_SOCK_STATE_CLOSING 4 /* -> CLOSED */
95 default: in con_flag_valid()
104 clear_bit(con_flag, &con->flags); in ceph_con_flag_clear()
111 set_bit(con_flag, &con->flags); in ceph_con_flag_set()
118 return test_bit(con_flag, &con->flags); in ceph_con_flag_test()
126 return test_and_clear_bit(con_flag, &con->flags); in ceph_con_flag_test_and_clear()
134 return test_and_set_bit(con_flag, &con->flags); in ceph_con_flag_test_and_set()
137 /* Slab caches for frequently-allocated structures */
156 #define ADDR_STR_COUNT_MASK (ADDR_STR_COUNT - 1)
168 struct sockaddr_storage ss = addr->in_addr; /* align */ in ceph_pr_addr()
178 le32_to_cpu(addr->type), &in4->sin_addr, in ceph_pr_addr()
179 ntohs(in4->sin_port)); in ceph_pr_addr()
184 le32_to_cpu(addr->type), &in6->sin6_addr, in ceph_pr_addr()
185 ntohs(in6->sin6_port)); in ceph_pr_addr()
188 default: in ceph_pr_addr()
200 memcpy(&msgr->my_enc_addr, &msgr->inst.addr, in ceph_encode_my_addr()
201 sizeof(msgr->my_enc_addr)); in ceph_encode_my_addr()
202 ceph_encode_banner_addr(&msgr->my_enc_addr); in ceph_encode_my_addr()
216 return -ENOMEM; in ceph_msgr_slab_init()
245 return -ENOMEM; in ceph_msgr_init()
253 * connections, so leave @max_active at default. in ceph_msgr_init()
255 ceph_msgr_wq = alloc_workqueue("ceph-msgr", WQ_MEM_RECLAIM, 0); in ceph_msgr_init()
262 return -ENOMEM; in ceph_msgr_init()
284 old_state = atomic_xchg(&con->sock_state, CON_SOCK_STATE_CLOSED); in con_sock_state_init()
287 dout("%s con %p sock %d -> %d\n", __func__, con, old_state, in con_sock_state_init()
295 old_state = atomic_xchg(&con->sock_state, CON_SOCK_STATE_CONNECTING); in con_sock_state_connecting()
298 dout("%s con %p sock %d -> %d\n", __func__, con, old_state, in con_sock_state_connecting()
306 old_state = atomic_xchg(&con->sock_state, CON_SOCK_STATE_CONNECTED); in con_sock_state_connected()
309 dout("%s con %p sock %d -> %d\n", __func__, con, old_state, in con_sock_state_connected()
317 old_state = atomic_xchg(&con->sock_state, CON_SOCK_STATE_CLOSING); in con_sock_state_closing()
322 dout("%s con %p sock %d -> %d\n", __func__, con, old_state, in con_sock_state_closing()
330 old_state = atomic_xchg(&con->sock_state, CON_SOCK_STATE_CLOSED); in con_sock_state_closed()
336 dout("%s con %p sock %d -> %d\n", __func__, con, old_state, in con_sock_state_closed()
347 struct ceph_connection *con = sk->sk_user_data; in ceph_sock_data_ready()
351 if (atomic_read(&con->msgr->stopping)) { in ceph_sock_data_ready()
355 if (sk->sk_state != TCP_CLOSE_WAIT) { in ceph_sock_data_ready()
356 dout("%s %p state = %d, queueing work\n", __func__, in ceph_sock_data_ready()
357 con, con->state); in ceph_sock_data_ready()
365 struct ceph_connection *con = sk->sk_user_data; in ceph_sock_write_space()
376 dout("%s %p queueing write work\n", __func__, con); in ceph_sock_write_space()
377 clear_bit(SOCK_NOSPACE, &sk->sk_socket->flags); in ceph_sock_write_space()
381 dout("%s %p nothing to write\n", __func__, con); in ceph_sock_write_space()
388 struct ceph_connection *con = sk->sk_user_data; in ceph_sock_state_change()
390 dout("%s %p state = %d sk_state = %u\n", __func__, in ceph_sock_state_change()
391 con, con->state, sk->sk_state); in ceph_sock_state_change()
393 switch (sk->sk_state) { in ceph_sock_state_change()
395 dout("%s TCP_CLOSE\n", __func__); in ceph_sock_state_change()
398 dout("%s TCP_CLOSE_WAIT\n", __func__); in ceph_sock_state_change()
404 dout("%s TCP_ESTABLISHED\n", __func__); in ceph_sock_state_change()
408 default: /* Everything else is uninteresting */ in ceph_sock_state_change()
419 struct sock *sk = sock->sk; in set_sock_callbacks()
420 sk->sk_user_data = con; in set_sock_callbacks()
421 sk->sk_data_ready = ceph_sock_data_ready; in set_sock_callbacks()
422 sk->sk_write_space = ceph_sock_write_space; in set_sock_callbacks()
423 sk->sk_state_change = ceph_sock_state_change; in set_sock_callbacks()
436 struct sockaddr_storage ss = con->peer_addr.in_addr; /* align */ in ceph_tcp_connect()
441 dout("%s con %p peer_addr %s\n", __func__, con, in ceph_tcp_connect()
442 ceph_pr_addr(&con->peer_addr)); in ceph_tcp_connect()
443 BUG_ON(con->sock); in ceph_tcp_connect()
447 ret = sock_create_kern(read_pnet(&con->msgr->net), ss.ss_family, in ceph_tcp_connect()
452 sock->sk->sk_allocation = GFP_NOFS; in ceph_tcp_connect()
453 sock->sk->sk_use_task_frag = false; in ceph_tcp_connect()
456 lockdep_set_class(&sock->sk->sk_lock, &socket_class); in ceph_tcp_connect()
464 if (ret == -EINPROGRESS) { in ceph_tcp_connect()
465 dout("connect %s EINPROGRESS sk_state = %u\n", in ceph_tcp_connect()
466 ceph_pr_addr(&con->peer_addr), in ceph_tcp_connect()
467 sock->sk->sk_state); in ceph_tcp_connect()
470 ceph_pr_addr(&con->peer_addr), ret); in ceph_tcp_connect()
475 if (ceph_test_opt(from_msgr(con->msgr), TCP_NODELAY)) in ceph_tcp_connect()
476 tcp_sock_set_nodelay(sock->sk); in ceph_tcp_connect()
478 con->sock = sock; in ceph_tcp_connect()
489 dout("%s con %p sock %p\n", __func__, con, con->sock); in ceph_con_close_socket()
490 if (con->sock) { in ceph_con_close_socket()
491 rc = con->sock->ops->shutdown(con->sock, SHUT_RDWR); in ceph_con_close_socket()
492 sock_release(con->sock); in ceph_con_close_socket()
493 con->sock = NULL; in ceph_con_close_socket()
510 dout("%s con %p\n", __func__, con); in ceph_con_reset_protocol()
513 if (con->in_msg) { in ceph_con_reset_protocol()
514 WARN_ON(con->in_msg->con != con); in ceph_con_reset_protocol()
515 ceph_msg_put(con->in_msg); in ceph_con_reset_protocol()
516 con->in_msg = NULL; in ceph_con_reset_protocol()
518 if (con->out_msg) { in ceph_con_reset_protocol()
519 WARN_ON(con->out_msg->con != con); in ceph_con_reset_protocol()
520 ceph_msg_put(con->out_msg); in ceph_con_reset_protocol()
521 con->out_msg = NULL; in ceph_con_reset_protocol()
523 if (con->bounce_page) { in ceph_con_reset_protocol()
524 __free_page(con->bounce_page); in ceph_con_reset_protocol()
525 con->bounce_page = NULL; in ceph_con_reset_protocol()
528 if (ceph_msgr2(from_msgr(con->msgr))) in ceph_con_reset_protocol()
540 list_del_init(&msg->list_head); in ceph_msg_remove()
556 dout("%s con %p\n", __func__, con); in ceph_con_reset_session()
558 WARN_ON(con->in_msg); in ceph_con_reset_session()
559 WARN_ON(con->out_msg); in ceph_con_reset_session()
560 ceph_msg_remove_list(&con->out_queue); in ceph_con_reset_session()
561 ceph_msg_remove_list(&con->out_sent); in ceph_con_reset_session()
562 con->out_seq = 0; in ceph_con_reset_session()
563 con->in_seq = 0; in ceph_con_reset_session()
564 con->in_seq_acked = 0; in ceph_con_reset_session()
566 if (ceph_msgr2(from_msgr(con->msgr))) in ceph_con_reset_session()
577 mutex_lock(&con->mutex); in ceph_con_close()
578 dout("con_close %p peer %s\n", con, ceph_pr_addr(&con->peer_addr)); in ceph_con_close()
579 con->state = CEPH_CON_S_CLOSED; in ceph_con_close()
590 mutex_unlock(&con->mutex); in ceph_con_close()
601 mutex_lock(&con->mutex); in ceph_con_open()
602 dout("con_open %p %s\n", con, ceph_pr_addr(addr)); in ceph_con_open()
604 WARN_ON(con->state != CEPH_CON_S_CLOSED); in ceph_con_open()
605 con->state = CEPH_CON_S_PREOPEN; in ceph_con_open()
607 con->peer_name.type = (__u8) entity_type; in ceph_con_open()
608 con->peer_name.num = cpu_to_le64(entity_num); in ceph_con_open()
610 memcpy(&con->peer_addr, addr, sizeof(*addr)); in ceph_con_open()
611 con->delay = 0; /* reset backoff memory */ in ceph_con_open()
612 mutex_unlock(&con->mutex); in ceph_con_open()
622 if (ceph_msgr2(from_msgr(con->msgr))) in ceph_con_opened()
635 dout("con_init %p\n", con); in ceph_con_init()
637 con->private = private; in ceph_con_init()
638 con->ops = ops; in ceph_con_init()
639 con->msgr = msgr; in ceph_con_init()
643 mutex_init(&con->mutex); in ceph_con_init()
644 INIT_LIST_HEAD(&con->out_queue); in ceph_con_init()
645 INIT_LIST_HEAD(&con->out_sent); in ceph_con_init()
646 INIT_DELAYED_WORK(&con->work, ceph_con_workfn); in ceph_con_init()
648 con->state = CEPH_CON_S_CLOSED; in ceph_con_init()
660 spin_lock(&msgr->global_seq_lock); in ceph_get_global_seq()
661 if (msgr->global_seq < gt) in ceph_get_global_seq()
662 msgr->global_seq = gt; in ceph_get_global_seq()
663 ret = ++msgr->global_seq; in ceph_get_global_seq()
664 spin_unlock(&msgr->global_seq_lock); in ceph_get_global_seq()
676 dout("%s con %p ack_seq %llu\n", __func__, con, ack_seq); in ceph_con_discard_sent()
677 while (!list_empty(&con->out_sent)) { in ceph_con_discard_sent()
678 msg = list_first_entry(&con->out_sent, struct ceph_msg, in ceph_con_discard_sent()
680 WARN_ON(msg->needs_out_seq); in ceph_con_discard_sent()
681 seq = le64_to_cpu(msg->hdr.seq); in ceph_con_discard_sent()
685 dout("%s con %p discarding msg %p seq %llu\n", __func__, con, in ceph_con_discard_sent()
701 dout("%s con %p reconnect_seq %llu\n", __func__, con, reconnect_seq); in ceph_con_discard_requeued()
702 while (!list_empty(&con->out_queue)) { in ceph_con_discard_requeued()
703 msg = list_first_entry(&con->out_queue, struct ceph_msg, in ceph_con_discard_requeued()
705 if (msg->needs_out_seq) in ceph_con_discard_requeued()
707 seq = le64_to_cpu(msg->hdr.seq); in ceph_con_discard_requeued()
711 dout("%s con %p discarding msg %p seq %llu\n", __func__, con, in ceph_con_discard_requeued()
727 struct ceph_msg_data *data = cursor->data; in ceph_msg_data_bio_cursor_init()
728 struct ceph_bio_iter *it = &cursor->bio_iter; in ceph_msg_data_bio_cursor_init()
730 cursor->resid = min_t(size_t, length, data->bio_length); in ceph_msg_data_bio_cursor_init()
731 *it = data->bio_pos; in ceph_msg_data_bio_cursor_init()
732 if (cursor->resid < it->iter.bi_size) in ceph_msg_data_bio_cursor_init()
733 it->iter.bi_size = cursor->resid; in ceph_msg_data_bio_cursor_init()
735 BUG_ON(cursor->resid < bio_iter_len(it->bio, it->iter)); in ceph_msg_data_bio_cursor_init()
742 struct bio_vec bv = bio_iter_iovec(cursor->bio_iter.bio, in ceph_msg_data_bio_next()
743 cursor->bio_iter.iter); in ceph_msg_data_bio_next()
753 struct ceph_bio_iter *it = &cursor->bio_iter; in ceph_msg_data_bio_advance()
754 struct page *page = bio_iter_page(it->bio, it->iter); in ceph_msg_data_bio_advance()
756 BUG_ON(bytes > cursor->resid); in ceph_msg_data_bio_advance()
757 BUG_ON(bytes > bio_iter_len(it->bio, it->iter)); in ceph_msg_data_bio_advance()
758 cursor->resid -= bytes; in ceph_msg_data_bio_advance()
759 bio_advance_iter(it->bio, &it->iter, bytes); in ceph_msg_data_bio_advance()
761 if (!cursor->resid) in ceph_msg_data_bio_advance()
764 if (!bytes || (it->iter.bi_size && it->iter.bi_bvec_done && in ceph_msg_data_bio_advance()
765 page == bio_iter_page(it->bio, it->iter))) in ceph_msg_data_bio_advance()
768 if (!it->iter.bi_size) { in ceph_msg_data_bio_advance()
769 it->bio = it->bio->bi_next; in ceph_msg_data_bio_advance()
770 it->iter = it->bio->bi_iter; in ceph_msg_data_bio_advance()
771 if (cursor->resid < it->iter.bi_size) in ceph_msg_data_bio_advance()
772 it->iter.bi_size = cursor->resid; in ceph_msg_data_bio_advance()
775 BUG_ON(cursor->resid < bio_iter_len(it->bio, it->iter)); in ceph_msg_data_bio_advance()
783 struct ceph_msg_data *data = cursor->data; in ceph_msg_data_bvecs_cursor_init()
784 struct bio_vec *bvecs = data->bvec_pos.bvecs; in ceph_msg_data_bvecs_cursor_init()
786 cursor->resid = min_t(size_t, length, data->bvec_pos.iter.bi_size); in ceph_msg_data_bvecs_cursor_init()
787 cursor->bvec_iter = data->bvec_pos.iter; in ceph_msg_data_bvecs_cursor_init()
788 cursor->bvec_iter.bi_size = cursor->resid; in ceph_msg_data_bvecs_cursor_init()
790 BUG_ON(cursor->resid < bvec_iter_len(bvecs, cursor->bvec_iter)); in ceph_msg_data_bvecs_cursor_init()
797 struct bio_vec bv = bvec_iter_bvec(cursor->data->bvec_pos.bvecs, in ceph_msg_data_bvecs_next()
798 cursor->bvec_iter); in ceph_msg_data_bvecs_next()
808 struct bio_vec *bvecs = cursor->data->bvec_pos.bvecs; in ceph_msg_data_bvecs_advance()
809 struct page *page = bvec_iter_page(bvecs, cursor->bvec_iter); in ceph_msg_data_bvecs_advance()
811 BUG_ON(bytes > cursor->resid); in ceph_msg_data_bvecs_advance()
812 BUG_ON(bytes > bvec_iter_len(bvecs, cursor->bvec_iter)); in ceph_msg_data_bvecs_advance()
813 cursor->resid -= bytes; in ceph_msg_data_bvecs_advance()
814 bvec_iter_advance(bvecs, &cursor->bvec_iter, bytes); in ceph_msg_data_bvecs_advance()
816 if (!cursor->resid) in ceph_msg_data_bvecs_advance()
819 if (!bytes || (cursor->bvec_iter.bi_bvec_done && in ceph_msg_data_bvecs_advance()
820 page == bvec_iter_page(bvecs, cursor->bvec_iter))) in ceph_msg_data_bvecs_advance()
823 BUG_ON(cursor->resid < bvec_iter_len(bvecs, cursor->bvec_iter)); in ceph_msg_data_bvecs_advance()
834 struct ceph_msg_data *data = cursor->data; in ceph_msg_data_pages_cursor_init()
837 BUG_ON(data->type != CEPH_MSG_DATA_PAGES); in ceph_msg_data_pages_cursor_init()
839 BUG_ON(!data->pages); in ceph_msg_data_pages_cursor_init()
840 BUG_ON(!data->length); in ceph_msg_data_pages_cursor_init()
842 cursor->resid = min(length, data->length); in ceph_msg_data_pages_cursor_init()
843 page_count = calc_pages_for(data->alignment, (u64)data->length); in ceph_msg_data_pages_cursor_init()
844 cursor->page_offset = data->alignment & ~PAGE_MASK; in ceph_msg_data_pages_cursor_init()
845 cursor->page_index = 0; in ceph_msg_data_pages_cursor_init()
847 cursor->page_count = (unsigned short)page_count; in ceph_msg_data_pages_cursor_init()
848 BUG_ON(length > SIZE_MAX - cursor->page_offset); in ceph_msg_data_pages_cursor_init()
855 struct ceph_msg_data *data = cursor->data; in ceph_msg_data_pages_next()
857 BUG_ON(data->type != CEPH_MSG_DATA_PAGES); in ceph_msg_data_pages_next()
859 BUG_ON(cursor->page_index >= cursor->page_count); in ceph_msg_data_pages_next()
860 BUG_ON(cursor->page_offset >= PAGE_SIZE); in ceph_msg_data_pages_next()
862 *page_offset = cursor->page_offset; in ceph_msg_data_pages_next()
863 *length = min_t(size_t, cursor->resid, PAGE_SIZE - *page_offset); in ceph_msg_data_pages_next()
864 return data->pages[cursor->page_index]; in ceph_msg_data_pages_next()
870 BUG_ON(cursor->data->type != CEPH_MSG_DATA_PAGES); in ceph_msg_data_pages_advance()
872 BUG_ON(cursor->page_offset + bytes > PAGE_SIZE); in ceph_msg_data_pages_advance()
876 cursor->resid -= bytes; in ceph_msg_data_pages_advance()
877 cursor->page_offset = (cursor->page_offset + bytes) & ~PAGE_MASK; in ceph_msg_data_pages_advance()
878 if (!bytes || cursor->page_offset) in ceph_msg_data_pages_advance()
881 if (!cursor->resid) in ceph_msg_data_pages_advance()
886 BUG_ON(cursor->page_index >= cursor->page_count); in ceph_msg_data_pages_advance()
887 cursor->page_index++; in ceph_msg_data_pages_advance()
899 struct ceph_msg_data *data = cursor->data; in ceph_msg_data_pagelist_cursor_init()
903 BUG_ON(data->type != CEPH_MSG_DATA_PAGELIST); in ceph_msg_data_pagelist_cursor_init()
905 pagelist = data->pagelist; in ceph_msg_data_pagelist_cursor_init()
911 BUG_ON(list_empty(&pagelist->head)); in ceph_msg_data_pagelist_cursor_init()
912 page = list_first_entry(&pagelist->head, struct page, lru); in ceph_msg_data_pagelist_cursor_init()
914 cursor->resid = min(length, pagelist->length); in ceph_msg_data_pagelist_cursor_init()
915 cursor->page = page; in ceph_msg_data_pagelist_cursor_init()
916 cursor->offset = 0; in ceph_msg_data_pagelist_cursor_init()
923 struct ceph_msg_data *data = cursor->data; in ceph_msg_data_pagelist_next()
926 BUG_ON(data->type != CEPH_MSG_DATA_PAGELIST); in ceph_msg_data_pagelist_next()
928 pagelist = data->pagelist; in ceph_msg_data_pagelist_next()
931 BUG_ON(!cursor->page); in ceph_msg_data_pagelist_next()
932 BUG_ON(cursor->offset + cursor->resid != pagelist->length); in ceph_msg_data_pagelist_next()
935 *page_offset = cursor->offset & ~PAGE_MASK; in ceph_msg_data_pagelist_next()
936 *length = min_t(size_t, cursor->resid, PAGE_SIZE - *page_offset); in ceph_msg_data_pagelist_next()
937 return cursor->page; in ceph_msg_data_pagelist_next()
943 struct ceph_msg_data *data = cursor->data; in ceph_msg_data_pagelist_advance()
946 BUG_ON(data->type != CEPH_MSG_DATA_PAGELIST); in ceph_msg_data_pagelist_advance()
948 pagelist = data->pagelist; in ceph_msg_data_pagelist_advance()
951 BUG_ON(cursor->offset + cursor->resid != pagelist->length); in ceph_msg_data_pagelist_advance()
952 BUG_ON((cursor->offset & ~PAGE_MASK) + bytes > PAGE_SIZE); in ceph_msg_data_pagelist_advance()
956 cursor->resid -= bytes; in ceph_msg_data_pagelist_advance()
957 cursor->offset += bytes; in ceph_msg_data_pagelist_advance()
959 if (!bytes || cursor->offset & ~PAGE_MASK) in ceph_msg_data_pagelist_advance()
962 if (!cursor->resid) in ceph_msg_data_pagelist_advance()
967 BUG_ON(list_is_last(&cursor->page->lru, &pagelist->head)); in ceph_msg_data_pagelist_advance()
968 cursor->page = list_next_entry(cursor->page, lru); in ceph_msg_data_pagelist_advance()
975 struct ceph_msg_data *data = cursor->data; in ceph_msg_data_iter_cursor_init()
977 cursor->iov_iter = data->iter; in ceph_msg_data_iter_cursor_init()
978 cursor->lastlen = 0; in ceph_msg_data_iter_cursor_init()
979 iov_iter_truncate(&cursor->iov_iter, length); in ceph_msg_data_iter_cursor_init()
980 cursor->resid = iov_iter_count(&cursor->iov_iter); in ceph_msg_data_iter_cursor_init()
989 if (cursor->lastlen) in ceph_msg_data_iter_next()
990 iov_iter_revert(&cursor->iov_iter, cursor->lastlen); in ceph_msg_data_iter_next()
992 len = iov_iter_get_pages2(&cursor->iov_iter, &page, PAGE_SIZE, in ceph_msg_data_iter_next()
996 cursor->lastlen = len; in ceph_msg_data_iter_next()
1000 * are pinned, with the references held by the upper-level in ceph_msg_data_iter_next()
1008 *length = min_t(size_t, len, cursor->resid); in ceph_msg_data_iter_next()
1015 BUG_ON(bytes > cursor->resid); in ceph_msg_data_iter_advance()
1016 cursor->resid -= bytes; in ceph_msg_data_iter_advance()
1018 if (bytes < cursor->lastlen) { in ceph_msg_data_iter_advance()
1019 cursor->lastlen -= bytes; in ceph_msg_data_iter_advance()
1021 iov_iter_advance(&cursor->iov_iter, bytes - cursor->lastlen); in ceph_msg_data_iter_advance()
1022 cursor->lastlen = 0; in ceph_msg_data_iter_advance()
1025 return cursor->resid; in ceph_msg_data_iter_advance()
1038 size_t length = cursor->total_resid; in __ceph_msg_data_cursor_init()
1040 switch (cursor->data->type) { in __ceph_msg_data_cursor_init()
1059 default: in __ceph_msg_data_cursor_init()
1063 cursor->need_crc = true; in __ceph_msg_data_cursor_init()
1070 BUG_ON(length > msg->data_length); in ceph_msg_data_cursor_init()
1071 BUG_ON(!msg->num_data_items); in ceph_msg_data_cursor_init()
1073 cursor->total_resid = length; in ceph_msg_data_cursor_init()
1074 cursor->data = msg->data; in ceph_msg_data_cursor_init()
1075 cursor->sr_resid = 0; in ceph_msg_data_cursor_init()
1090 switch (cursor->data->type) { in ceph_msg_data_next()
1109 default: in ceph_msg_data_next()
1117 BUG_ON(*length > cursor->resid); in ceph_msg_data_next()
1130 BUG_ON(bytes > cursor->resid); in ceph_msg_data_advance()
1131 switch (cursor->data->type) { in ceph_msg_data_advance()
1150 default: in ceph_msg_data_advance()
1154 cursor->total_resid -= bytes; in ceph_msg_data_advance()
1156 if (!cursor->resid && cursor->total_resid) { in ceph_msg_data_advance()
1157 cursor->data++; in ceph_msg_data_advance()
1161 cursor->need_crc = new_piece; in ceph_msg_data_advance()
1179 struct sockaddr_storage ss = addr->in_addr; /* align */ in ceph_addr_is_blank()
1180 struct in_addr *addr4 = &((struct sockaddr_in *)&ss)->sin_addr; in ceph_addr_is_blank()
1181 struct in6_addr *addr6 = &((struct sockaddr_in6 *)&ss)->sin6_addr; in ceph_addr_is_blank()
1185 return addr4->s_addr == htonl(INADDR_ANY); in ceph_addr_is_blank()
1188 default: in ceph_addr_is_blank()
1196 switch (get_unaligned(&addr->in_addr.ss_family)) { in ceph_addr_port()
1198 return ntohs(get_unaligned(&((struct sockaddr_in *)&addr->in_addr)->sin_port)); in ceph_addr_port()
1200 return ntohs(get_unaligned(&((struct sockaddr_in6 *)&addr->in_addr)->sin6_port)); in ceph_addr_port()
1207 switch (get_unaligned(&addr->in_addr.ss_family)) { in ceph_addr_set_port()
1209 put_unaligned(htons(p), &((struct sockaddr_in *)&addr->in_addr)->sin_port); in ceph_addr_set_port()
1212 put_unaligned(htons(p), &((struct sockaddr_in6 *)&addr->in_addr)->sin6_port); in ceph_addr_set_port()
1223 memset(&addr->in_addr, 0, sizeof(addr->in_addr)); in ceph_pton()
1225 …if (in4_pton(str, len, (u8 *)&((struct sockaddr_in *)&addr->in_addr)->sin_addr.s_addr, delim, ipen… in ceph_pton()
1226 put_unaligned(AF_INET, &addr->in_addr.ss_family); in ceph_pton()
1230 …if (in6_pton(str, len, (u8 *)&((struct sockaddr_in6 *)&addr->in_addr)->sin6_addr.s6_addr, delim, i… in ceph_pton()
1231 put_unaligned(AF_INET6, &addr->in_addr.ss_family); in ceph_pton()
1235 return -EINVAL; in ceph_pton()
1267 return -EINVAL; in ceph_dns_resolve_name()
1270 ip_len = dns_query(current->nsproxy->net_ns, in ceph_dns_resolve_name()
1271 NULL, name, end - name, NULL, &ip_addr, NULL, false); in ceph_dns_resolve_name()
1273 ret = ceph_pton(ip_addr, ip_len, addr, -1, NULL); in ceph_dns_resolve_name()
1275 ret = -ESRCH; in ceph_dns_resolve_name()
1281 pr_info("resolve '%.*s' (ret=%d): %s\n", (int)(end - name), name, in ceph_dns_resolve_name()
1290 return -EINVAL; in ceph_dns_resolve_name()
1311 * Parse an ip[:port] list into an addr array. Use the default
1318 int i, ret = -EINVAL; in ceph_parse_ips()
1321 dout("parse_ips on '%.*s'\n", (int)(end-c), c); in ceph_parse_ips()
1332 ret = ceph_parse_server_name(p, end - p, &addr[i], cur_delim, in ceph_parse_ips()
1336 ret = -EINVAL; in ceph_parse_ips()
1342 dout("missing matching ']'\n"); in ceph_parse_ips()
1353 port = (port * 10) + (*p - '0'); in ceph_parse_ips()
1376 dout("%s got %s\n", __func__, ceph_pr_addr(&addr[i])); in ceph_parse_ips()
1403 struct ceph_msg *msg = con->in_msg; in ceph_con_process_message()
1405 BUG_ON(con->in_msg->con != con); in ceph_con_process_message()
1406 con->in_msg = NULL; in ceph_con_process_message()
1409 if (con->peer_name.type == 0) in ceph_con_process_message()
1410 con->peer_name = msg->hdr.src; in ceph_con_process_message()
1412 con->in_seq++; in ceph_con_process_message()
1413 mutex_unlock(&con->mutex); in ceph_con_process_message()
1415 dout("===== %p %llu from %s%lld %d=%s len %d+%d+%d (%u %u %u) =====\n", in ceph_con_process_message()
1416 msg, le64_to_cpu(msg->hdr.seq), in ceph_con_process_message()
1417 ENTITY_NAME(msg->hdr.src), in ceph_con_process_message()
1418 le16_to_cpu(msg->hdr.type), in ceph_con_process_message()
1419 ceph_msg_type_name(le16_to_cpu(msg->hdr.type)), in ceph_con_process_message()
1420 le32_to_cpu(msg->hdr.front_len), in ceph_con_process_message()
1421 le32_to_cpu(msg->hdr.middle_len), in ceph_con_process_message()
1422 le32_to_cpu(msg->hdr.data_len), in ceph_con_process_message()
1423 con->in_front_crc, con->in_middle_crc, con->in_data_crc); in ceph_con_process_message()
1424 con->ops->dispatch(con, msg); in ceph_con_process_message()
1426 mutex_lock(&con->mutex); in ceph_con_process_message()
1436 if (!con->ops->get(con)) { in queue_con_delay()
1437 dout("%s %p ref count 0\n", __func__, con); in queue_con_delay()
1438 return -ENOENT; in queue_con_delay()
1444 dout("%s %p %lu\n", __func__, con, delay); in queue_con_delay()
1445 if (!queue_delayed_work(ceph_msgr_wq, &con->work, delay)) { in queue_con_delay()
1446 dout("%s %p - already queued\n", __func__, con); in queue_con_delay()
1447 con->ops->put(con); in queue_con_delay()
1448 return -EBUSY; in queue_con_delay()
1461 if (cancel_delayed_work(&con->work)) { in cancel_con()
1462 dout("%s %p\n", __func__, con); in cancel_con()
1463 con->ops->put(con); in cancel_con()
1474 con->error_msg = "socket closed (con state " #x ")"; \ in con_sock_closed()
1477 switch (con->state) { in con_sock_closed()
1491 default: in con_sock_closed()
1506 ret = queue_con_delay(con, con->delay); in con_backoff()
1508 dout("%s: con %p FAILED to back off %lu\n", __func__, in con_backoff()
1509 con, con->delay); in con_backoff()
1510 BUG_ON(ret == -ENOENT); in con_backoff()
1517 /* Finish fault handling; con->mutex must *not* be held here */
1521 dout("%s %p\n", __func__, con); in con_fault_finish()
1527 if (con->v1.auth_retry) { in con_fault_finish()
1528 dout("auth_retry %d, invalidating\n", con->v1.auth_retry); in con_fault_finish()
1529 if (con->ops->invalidate_authorizer) in con_fault_finish()
1530 con->ops->invalidate_authorizer(con); in con_fault_finish()
1531 con->v1.auth_retry = 0; in con_fault_finish()
1534 if (con->ops->fault) in con_fault_finish()
1535 con->ops->fault(con); in con_fault_finish()
1547 mutex_lock(&con->mutex); in ceph_con_workfn()
1552 dout("%s: con %p SOCK_CLOSED\n", __func__, con); in ceph_con_workfn()
1556 dout("%s: con %p BACKOFF\n", __func__, con); in ceph_con_workfn()
1559 if (con->state == CEPH_CON_S_STANDBY) { in ceph_con_workfn()
1560 dout("%s: con %p STANDBY\n", __func__, con); in ceph_con_workfn()
1563 if (con->state == CEPH_CON_S_CLOSED) { in ceph_con_workfn()
1564 dout("%s: con %p CLOSED\n", __func__, con); in ceph_con_workfn()
1565 BUG_ON(con->sock); in ceph_con_workfn()
1568 if (con->state == CEPH_CON_S_PREOPEN) { in ceph_con_workfn()
1569 dout("%s: con %p PREOPEN\n", __func__, con); in ceph_con_workfn()
1570 BUG_ON(con->sock); in ceph_con_workfn()
1573 if (ceph_msgr2(from_msgr(con->msgr))) in ceph_con_workfn()
1578 if (ret == -EAGAIN) in ceph_con_workfn()
1580 if (!con->error_msg) in ceph_con_workfn()
1581 con->error_msg = "socket error on read"; in ceph_con_workfn()
1586 if (ceph_msgr2(from_msgr(con->msgr))) in ceph_con_workfn()
1591 if (ret == -EAGAIN) in ceph_con_workfn()
1593 if (!con->error_msg) in ceph_con_workfn()
1594 con->error_msg = "socket error on write"; in ceph_con_workfn()
1602 mutex_unlock(&con->mutex); in ceph_con_workfn()
1607 con->ops->put(con); in ceph_con_workfn()
1616 dout("fault %p state %d to peer %s\n", in con_fault()
1617 con, con->state, ceph_pr_addr(&con->peer_addr)); in con_fault()
1619 pr_warn("%s%lld %s %s\n", ENTITY_NAME(con->peer_name), in con_fault()
1620 ceph_pr_addr(&con->peer_addr), con->error_msg); in con_fault()
1621 con->error_msg = NULL; in con_fault()
1623 WARN_ON(con->state == CEPH_CON_S_STANDBY || in con_fault()
1624 con->state == CEPH_CON_S_CLOSED); in con_fault()
1629 dout("fault on LOSSYTX channel, marking CLOSED\n"); in con_fault()
1630 con->state = CEPH_CON_S_CLOSED; in con_fault()
1635 list_splice_init(&con->out_sent, &con->out_queue); in con_fault()
1639 if (list_empty(&con->out_queue) && in con_fault()
1641 dout("fault %p setting STANDBY clearing WRITE_PENDING\n", con); in con_fault()
1643 con->state = CEPH_CON_S_STANDBY; in con_fault()
1646 con->state = CEPH_CON_S_PREOPEN; in con_fault()
1647 if (!con->delay) { in con_fault()
1648 con->delay = BASE_DELAY_INTERVAL; in con_fault()
1649 } else if (con->delay < MAX_DELAY_INTERVAL) { in con_fault()
1650 con->delay *= 2; in con_fault()
1651 if (con->delay > MAX_DELAY_INTERVAL) in con_fault()
1652 con->delay = MAX_DELAY_INTERVAL; in con_fault()
1661 u32 nonce = le32_to_cpu(msgr->inst.addr.nonce) + 1000000; in ceph_messenger_reset_nonce()
1662 msgr->inst.addr.nonce = cpu_to_le32(nonce); in ceph_messenger_reset_nonce()
1672 spin_lock_init(&msgr->global_seq_lock); in ceph_messenger_init()
1675 memcpy(&msgr->inst.addr.in_addr, &myaddr->in_addr, in ceph_messenger_init()
1676 sizeof(msgr->inst.addr.in_addr)); in ceph_messenger_init()
1677 ceph_addr_set_port(&msgr->inst.addr, 0); in ceph_messenger_init()
1684 msgr->inst.addr.type = CEPH_ENTITY_ADDR_TYPE_ANY; in ceph_messenger_init()
1686 /* generate a random non-zero nonce */ in ceph_messenger_init()
1688 get_random_bytes(&msgr->inst.addr.nonce, in ceph_messenger_init()
1689 sizeof(msgr->inst.addr.nonce)); in ceph_messenger_init()
1690 } while (!msgr->inst.addr.nonce); in ceph_messenger_init()
1693 atomic_set(&msgr->stopping, 0); in ceph_messenger_init()
1694 write_pnet(&msgr->net, get_net(current->nsproxy->net_ns)); in ceph_messenger_init()
1696 dout("%s %p\n", __func__, msgr); in ceph_messenger_init()
1701 put_net(read_pnet(&msgr->net)); in ceph_messenger_fini()
1706 if (msg->con) in msg_con_set()
1707 msg->con->ops->put(msg->con); in msg_con_set()
1709 msg->con = con ? con->ops->get(con) : NULL; in msg_con_set()
1710 BUG_ON(msg->con != con); in msg_con_set()
1716 if (con->state == CEPH_CON_S_STANDBY) { in clear_standby()
1717 dout("clear_standby %p and ++connect_seq\n", con); in clear_standby()
1718 con->state = CEPH_CON_S_PREOPEN; in clear_standby()
1719 con->v1.connect_seq++; in clear_standby()
1733 msg->hdr.src = con->msgr->inst.name; in ceph_con_send()
1734 BUG_ON(msg->front.iov_len != le32_to_cpu(msg->hdr.front_len)); in ceph_con_send()
1735 msg->needs_out_seq = true; in ceph_con_send()
1737 mutex_lock(&con->mutex); in ceph_con_send()
1739 if (con->state == CEPH_CON_S_CLOSED) { in ceph_con_send()
1740 dout("con_send %p closed, dropping %p\n", con, msg); in ceph_con_send()
1742 mutex_unlock(&con->mutex); in ceph_con_send()
1748 BUG_ON(!list_empty(&msg->list_head)); in ceph_con_send()
1749 list_add_tail(&msg->list_head, &con->out_queue); in ceph_con_send()
1750 dout("----- %p to %s%lld %d=%s len %d+%d+%d -----\n", msg, in ceph_con_send()
1751 ENTITY_NAME(con->peer_name), le16_to_cpu(msg->hdr.type), in ceph_con_send()
1752 ceph_msg_type_name(le16_to_cpu(msg->hdr.type)), in ceph_con_send()
1753 le32_to_cpu(msg->hdr.front_len), in ceph_con_send()
1754 le32_to_cpu(msg->hdr.middle_len), in ceph_con_send()
1755 le32_to_cpu(msg->hdr.data_len)); in ceph_con_send()
1758 mutex_unlock(&con->mutex); in ceph_con_send()
1772 struct ceph_connection *con = msg->con; in ceph_msg_revoke()
1775 dout("%s msg %p null con\n", __func__, msg); in ceph_msg_revoke()
1779 mutex_lock(&con->mutex); in ceph_msg_revoke()
1780 if (list_empty(&msg->list_head)) { in ceph_msg_revoke()
1781 WARN_ON(con->out_msg == msg); in ceph_msg_revoke()
1782 dout("%s con %p msg %p not linked\n", __func__, con, msg); in ceph_msg_revoke()
1783 mutex_unlock(&con->mutex); in ceph_msg_revoke()
1787 dout("%s con %p msg %p was linked\n", __func__, con, msg); in ceph_msg_revoke()
1788 msg->hdr.seq = 0; in ceph_msg_revoke()
1791 if (con->out_msg == msg) { in ceph_msg_revoke()
1792 WARN_ON(con->state != CEPH_CON_S_OPEN); in ceph_msg_revoke()
1793 dout("%s con %p msg %p was sending\n", __func__, con, msg); in ceph_msg_revoke()
1794 if (ceph_msgr2(from_msgr(con->msgr))) in ceph_msg_revoke()
1798 ceph_msg_put(con->out_msg); in ceph_msg_revoke()
1799 con->out_msg = NULL; in ceph_msg_revoke()
1801 dout("%s con %p msg %p not current, out_msg %p\n", __func__, in ceph_msg_revoke()
1802 con, msg, con->out_msg); in ceph_msg_revoke()
1804 mutex_unlock(&con->mutex); in ceph_msg_revoke()
1812 struct ceph_connection *con = msg->con; in ceph_msg_revoke_incoming()
1815 dout("%s msg %p null con\n", __func__, msg); in ceph_msg_revoke_incoming()
1819 mutex_lock(&con->mutex); in ceph_msg_revoke_incoming()
1820 if (con->in_msg == msg) { in ceph_msg_revoke_incoming()
1821 WARN_ON(con->state != CEPH_CON_S_OPEN); in ceph_msg_revoke_incoming()
1822 dout("%s con %p msg %p was recving\n", __func__, con, msg); in ceph_msg_revoke_incoming()
1823 if (ceph_msgr2(from_msgr(con->msgr))) in ceph_msg_revoke_incoming()
1827 ceph_msg_put(con->in_msg); in ceph_msg_revoke_incoming()
1828 con->in_msg = NULL; in ceph_msg_revoke_incoming()
1830 dout("%s con %p msg %p not current, in_msg %p\n", __func__, in ceph_msg_revoke_incoming()
1831 con, msg, con->in_msg); in ceph_msg_revoke_incoming()
1833 mutex_unlock(&con->mutex); in ceph_msg_revoke_incoming()
1841 dout("con_keepalive %p\n", con); in ceph_con_keepalive()
1842 mutex_lock(&con->mutex); in ceph_con_keepalive()
1845 mutex_unlock(&con->mutex); in ceph_con_keepalive()
1856 (con->peer_features & CEPH_FEATURE_MSGR_KEEPALIVE2)) { in ceph_con_keepalive_expired()
1861 ts = timespec64_add(con->last_keepalive_ack, ts); in ceph_con_keepalive_expired()
1869 BUG_ON(msg->num_data_items >= msg->max_data_items); in ceph_msg_data_add()
1870 return &msg->data[msg->num_data_items++]; in ceph_msg_data_add()
1875 if (data->type == CEPH_MSG_DATA_PAGES && data->own_pages) { in ceph_msg_data_destroy()
1876 int num_pages = calc_pages_for(data->alignment, data->length); in ceph_msg_data_destroy()
1877 ceph_release_page_vector(data->pages, num_pages); in ceph_msg_data_destroy()
1878 } else if (data->type == CEPH_MSG_DATA_PAGELIST) { in ceph_msg_data_destroy()
1879 ceph_pagelist_release(data->pagelist); in ceph_msg_data_destroy()
1892 data->type = CEPH_MSG_DATA_PAGES; in ceph_msg_data_add_pages()
1893 data->pages = pages; in ceph_msg_data_add_pages()
1894 data->length = length; in ceph_msg_data_add_pages()
1895 data->alignment = alignment & ~PAGE_MASK; in ceph_msg_data_add_pages()
1896 data->own_pages = own_pages; in ceph_msg_data_add_pages()
1898 msg->data_length += length; in ceph_msg_data_add_pages()
1908 BUG_ON(!pagelist->length); in ceph_msg_data_add_pagelist()
1911 data->type = CEPH_MSG_DATA_PAGELIST; in ceph_msg_data_add_pagelist()
1912 refcount_inc(&pagelist->refcnt); in ceph_msg_data_add_pagelist()
1913 data->pagelist = pagelist; in ceph_msg_data_add_pagelist()
1915 msg->data_length += pagelist->length; in ceph_msg_data_add_pagelist()
1926 data->type = CEPH_MSG_DATA_BIO; in ceph_msg_data_add_bio()
1927 data->bio_pos = *bio_pos; in ceph_msg_data_add_bio()
1928 data->bio_length = length; in ceph_msg_data_add_bio()
1930 msg->data_length += length; in ceph_msg_data_add_bio()
1941 data->type = CEPH_MSG_DATA_BVECS; in ceph_msg_data_add_bvecs()
1942 data->bvec_pos = *bvec_pos; in ceph_msg_data_add_bvecs()
1944 msg->data_length += bvec_pos->iter.bi_size; in ceph_msg_data_add_bvecs()
1954 data->type = CEPH_MSG_DATA_ITER; in ceph_msg_data_add_iter()
1955 data->iter = *iter; in ceph_msg_data_add_iter()
1957 msg->data_length += iov_iter_count(&data->iter); in ceph_msg_data_add_iter()
1973 m->hdr.type = cpu_to_le16(type); in ceph_msg_new2()
1974 m->hdr.priority = cpu_to_le16(CEPH_MSG_PRIO_DEFAULT); in ceph_msg_new2()
1975 m->hdr.front_len = cpu_to_le32(front_len); in ceph_msg_new2()
1977 INIT_LIST_HEAD(&m->list_head); in ceph_msg_new2()
1978 kref_init(&m->kref); in ceph_msg_new2()
1982 m->front.iov_base = kvmalloc(front_len, flags); in ceph_msg_new2()
1983 if (m->front.iov_base == NULL) { in ceph_msg_new2()
1984 dout("ceph_msg_new can't allocate %d bytes\n", in ceph_msg_new2()
1989 m->front.iov_base = NULL; in ceph_msg_new2()
1991 m->front_alloc_len = m->front.iov_len = front_len; in ceph_msg_new2()
1994 m->data = kmalloc_array(max_data_items, sizeof(*m->data), in ceph_msg_new2()
1996 if (!m->data) in ceph_msg_new2()
1999 m->max_data_items = max_data_items; in ceph_msg_new2()
2002 dout("ceph_msg_new %p front %d\n", m, front_len); in ceph_msg_new2()
2013 dout("msg_new can't create type %d front %d\n", type, in ceph_msg_new2()
2029 * allocated by alloc_msg. This allows us to read a small fixed-size
2030 * per-type header in the front and then gracefully fail (i.e.,
2036 int type = le16_to_cpu(msg->hdr.type); in ceph_alloc_middle()
2037 int middle_len = le32_to_cpu(msg->hdr.middle_len); in ceph_alloc_middle()
2039 dout("alloc_middle %p type %d %s middle_len %d\n", msg, type, in ceph_alloc_middle()
2042 BUG_ON(msg->middle); in ceph_alloc_middle()
2044 msg->middle = ceph_buffer_new(middle_len, GFP_NOFS); in ceph_alloc_middle()
2045 if (!msg->middle) in ceph_alloc_middle()
2046 return -ENOMEM; in ceph_alloc_middle()
2052 * connection, and save the result in con->in_msg. Uses the
2058 * - the next message should be skipped and ignored.
2059 * - con->in_msg == NULL
2061 * - con->in_msg is non-null.
2063 * - con->in_msg == NULL
2068 int middle_len = le32_to_cpu(hdr->middle_len); in ceph_con_in_msg_alloc()
2072 BUG_ON(con->in_msg != NULL); in ceph_con_in_msg_alloc()
2073 BUG_ON(!con->ops->alloc_msg); in ceph_con_in_msg_alloc()
2075 mutex_unlock(&con->mutex); in ceph_con_in_msg_alloc()
2076 msg = con->ops->alloc_msg(con, hdr, skip); in ceph_con_in_msg_alloc()
2077 mutex_lock(&con->mutex); in ceph_con_in_msg_alloc()
2078 if (con->state != CEPH_CON_S_OPEN) { in ceph_con_in_msg_alloc()
2081 return -EAGAIN; in ceph_con_in_msg_alloc()
2086 con->in_msg = msg; in ceph_con_in_msg_alloc()
2096 con->error_msg = "error allocating memory for incoming message"; in ceph_con_in_msg_alloc()
2097 return -ENOMEM; in ceph_con_in_msg_alloc()
2099 memcpy(&con->in_msg->hdr, hdr, sizeof(*hdr)); in ceph_con_in_msg_alloc()
2101 if (middle_len && !con->in_msg->middle) { in ceph_con_in_msg_alloc()
2102 ret = ceph_alloc_middle(con, con->in_msg); in ceph_con_in_msg_alloc()
2104 ceph_msg_put(con->in_msg); in ceph_con_in_msg_alloc()
2105 con->in_msg = NULL; in ceph_con_in_msg_alloc()
2116 BUG_ON(list_empty(&con->out_queue)); in ceph_con_get_out_msg()
2117 msg = list_first_entry(&con->out_queue, struct ceph_msg, list_head); in ceph_con_get_out_msg()
2118 WARN_ON(msg->con != con); in ceph_con_get_out_msg()
2124 list_move_tail(&msg->list_head, &con->out_sent); in ceph_con_get_out_msg()
2130 if (msg->needs_out_seq) { in ceph_con_get_out_msg()
2131 msg->hdr.seq = cpu_to_le64(++con->out_seq); in ceph_con_get_out_msg()
2132 msg->needs_out_seq = false; in ceph_con_get_out_msg()
2134 if (con->ops->reencode_message) in ceph_con_get_out_msg()
2135 con->ops->reencode_message(msg); in ceph_con_get_out_msg()
2142 WARN_ON(con->out_msg); in ceph_con_get_out_msg()
2143 con->out_msg = ceph_msg_get(msg); in ceph_con_get_out_msg()
2151 dout("%s %p\n", __func__, m); in ceph_msg_free()
2152 kvfree(m->front.iov_base); in ceph_msg_free()
2153 kfree(m->data); in ceph_msg_free()
2162 dout("%s %p\n", __func__, m); in ceph_msg_release()
2163 WARN_ON(!list_empty(&m->list_head)); in ceph_msg_release()
2168 if (m->middle) { in ceph_msg_release()
2169 ceph_buffer_put(m->middle); in ceph_msg_release()
2170 m->middle = NULL; in ceph_msg_release()
2173 for (i = 0; i < m->num_data_items; i++) in ceph_msg_release()
2174 ceph_msg_data_destroy(&m->data[i]); in ceph_msg_release()
2176 if (m->pool) in ceph_msg_release()
2177 ceph_msgpool_put(m->pool, m); in ceph_msg_release()
2184 dout("%s %p (was %d)\n", __func__, msg, in ceph_msg_get()
2185 kref_read(&msg->kref)); in ceph_msg_get()
2186 kref_get(&msg->kref); in ceph_msg_get()
2193 dout("%s %p (was %d)\n", __func__, msg, in ceph_msg_put()
2194 kref_read(&msg->kref)); in ceph_msg_put()
2195 kref_put(&msg->kref, ceph_msg_release); in ceph_msg_put()
2202 msg->front_alloc_len, msg->data_length); in ceph_msg_dump()
2205 &msg->hdr, sizeof(msg->hdr), true); in ceph_msg_dump()
2208 msg->front.iov_base, msg->front.iov_len, true); in ceph_msg_dump()
2209 if (msg->middle) in ceph_msg_dump()
2212 msg->middle->vec.iov_base, in ceph_msg_dump()
2213 msg->middle->vec.iov_len, true); in ceph_msg_dump()
2216 &msg->footer, sizeof(msg->footer), true); in ceph_msg_dump()