Lines Matching refs:msg

743 static int parse_reply_info(struct ceph_mds_session *s, struct ceph_msg *msg,  in parse_reply_info()  argument
751 info->head = msg->front.iov_base; in parse_reply_info()
752 p = msg->front.iov_base + sizeof(struct ceph_mds_reply_head); in parse_reply_info()
753 end = p + msg->front.iov_len - sizeof(struct ceph_mds_reply_head); in parse_reply_info()
787 ceph_msg_dump(msg); in parse_reply_info()
1429 struct ceph_msg *msg; in ceph_create_session_msg() local
1432 msg = ceph_msg_new(CEPH_MSG_CLIENT_SESSION, sizeof(*h), GFP_NOFS, in ceph_create_session_msg()
1434 if (!msg) { in ceph_create_session_msg()
1439 h = msg->front.iov_base; in ceph_create_session_msg()
1443 return msg; in ceph_create_session_msg()
1525 struct ceph_msg *msg; in create_session_open_msg() local
1567 msg = ceph_msg_new(CEPH_MSG_CLIENT_SESSION, sizeof(*h) + extra_bytes, in create_session_open_msg()
1569 if (!msg) { in create_session_open_msg()
1573 p = msg->front.iov_base; in create_session_open_msg()
1574 end = p + msg->front.iov_len; in create_session_open_msg()
1586 msg->hdr.version = cpu_to_le16(4); in create_session_open_msg()
1587 msg->hdr.compat_version = cpu_to_le16(1); in create_session_open_msg()
1611 ceph_msg_put(msg); in create_session_open_msg()
1618 ceph_msg_put(msg); in create_session_open_msg()
1622 msg->front.iov_len = p - msg->front.iov_base; in create_session_open_msg()
1623 msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); in create_session_open_msg()
1625 return msg; in create_session_open_msg()
1636 struct ceph_msg *msg; in __open_session() local
1651 msg = create_session_open_msg(mdsc, session->s_seq); in __open_session()
1652 if (IS_ERR(msg)) in __open_session()
1653 return PTR_ERR(msg); in __open_session()
1654 ceph_con_send(&session->s_con, msg); in __open_session()
1988 struct ceph_msg *msg; in send_renew_caps() local
2007 msg = ceph_create_session_msg(CEPH_SESSION_REQUEST_RENEWCAPS, in send_renew_caps()
2009 if (!msg) in send_renew_caps()
2011 ceph_con_send(&session->s_con, msg); in send_renew_caps()
2018 struct ceph_msg *msg; in send_flushmsg_ack() local
2022 msg = ceph_create_session_msg(CEPH_SESSION_FLUSHMSG_ACK, seq); in send_flushmsg_ack()
2023 if (!msg) in send_flushmsg_ack()
2025 ceph_con_send(&session->s_con, msg); in send_flushmsg_ack()
2069 struct ceph_msg *msg; in request_close_session() local
2074 msg = ceph_create_session_msg(CEPH_SESSION_REQUEST_CLOSE, in request_close_session()
2076 if (!msg) in request_close_session()
2078 ceph_con_send(&session->s_con, msg); in request_close_session()
2270 struct ceph_msg *msg = NULL; in ceph_send_cap_releases() local
2291 if (!msg) { in ceph_send_cap_releases()
2292 msg = ceph_msg_new(CEPH_MSG_CLIENT_CAPRELEASE, in ceph_send_cap_releases()
2294 if (!msg) in ceph_send_cap_releases()
2296 head = msg->front.iov_base; in ceph_send_cap_releases()
2298 msg->front.iov_len = sizeof(*head); in ceph_send_cap_releases()
2300 msg->hdr.version = cpu_to_le16(2); in ceph_send_cap_releases()
2301 msg->hdr.compat_version = cpu_to_le16(1); in ceph_send_cap_releases()
2309 head = msg->front.iov_base; in ceph_send_cap_releases()
2312 item = msg->front.iov_base + msg->front.iov_len; in ceph_send_cap_releases()
2317 msg->front.iov_len += sizeof(*item); in ceph_send_cap_releases()
2323 cap_barrier = msg->front.iov_base + msg->front.iov_len; in ceph_send_cap_releases()
2325 msg->front.iov_len += sizeof(*cap_barrier); in ceph_send_cap_releases()
2327 msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); in ceph_send_cap_releases()
2328 dout("send_cap_releases mds%d %p\n", session->s_mds, msg); in ceph_send_cap_releases()
2329 ceph_con_send(&session->s_con, msg); in ceph_send_cap_releases()
2330 msg = NULL; in ceph_send_cap_releases()
2341 if (msg) { in ceph_send_cap_releases()
2343 cap_barrier = msg->front.iov_base + msg->front.iov_len; in ceph_send_cap_releases()
2345 msg->front.iov_len += sizeof(*cap_barrier); in ceph_send_cap_releases()
2347 msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); in ceph_send_cap_releases()
2348 dout("send_cap_releases mds%d %p\n", session->s_mds, msg); in ceph_send_cap_releases()
2349 ceph_con_send(&session->s_con, msg); in ceph_send_cap_releases()
2868 struct ceph_msg *msg; in create_request_message() local
2890 msg = ERR_PTR(ret); in create_request_message()
2903 msg = ERR_PTR(ret); in create_request_message()
2909 msg = ERR_CAST(req->r_altname); in create_request_message()
2963 msg = ceph_msg_new2(CEPH_MSG_CLIENT_REQUEST, len, 1, GFP_NOFS, false); in create_request_message()
2964 if (!msg) { in create_request_message()
2965 msg = ERR_PTR(-ENOMEM); in create_request_message()
2969 msg->hdr.tid = cpu_to_le64(req->r_tid); in create_request_message()
2971 lhead = find_legacy_request_head(msg->front.iov_base, in create_request_message()
2979 msg->hdr.version = cpu_to_le16(3); in create_request_message()
2980 p = msg->front.iov_base + sizeof(*lhead); in create_request_message()
2982 struct ceph_mds_request_head_old *ohead = msg->front.iov_base; in create_request_message()
2984 msg->hdr.version = cpu_to_le16(4); in create_request_message()
2986 p = msg->front.iov_base + sizeof(*ohead); in create_request_message()
2988 struct ceph_mds_request_head *nhead = msg->front.iov_base; in create_request_message()
2990 msg->hdr.version = cpu_to_le16(6); in create_request_message()
2992 p = msg->front.iov_base + sizeof(*nhead); in create_request_message()
2995 end = msg->front.iov_base + msg->front.iov_len; in create_request_message()
3010 req->r_request_release_offset = p - msg->front.iov_base; in create_request_message()
3043 p = msg->front.iov_base + req->r_request_release_offset; in create_request_message()
3051 ceph_msg_put(msg); in create_request_message()
3052 msg = ERR_PTR(-ERANGE); in create_request_message()
3056 msg->front.iov_len = p - msg->front.iov_base; in create_request_message()
3057 msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); in create_request_message()
3061 ceph_msg_data_add_pagelist(msg, pagelist); in create_request_message()
3062 msg->hdr.data_len = cpu_to_le32(pagelist->length); in create_request_message()
3064 msg->hdr.data_len = 0; in create_request_message()
3067 msg->hdr.data_off = cpu_to_le16(0); in create_request_message()
3076 return msg; in create_request_message()
3078 ceph_msg_put(msg); in create_request_message()
3079 msg = ERR_PTR(ret); in create_request_message()
3108 struct ceph_msg *msg; in __prepare_send_request() local
3152 msg = req->r_request; in __prepare_send_request()
3153 lhead = find_legacy_request_head(msg->front.iov_base, in __prepare_send_request()
3165 nhead = (struct ceph_mds_request_head*)msg->front.iov_base; in __prepare_send_request()
3172 p = msg->front.iov_base + req->r_request_release_offset; in __prepare_send_request()
3175 msg->front.iov_len = p - msg->front.iov_base; in __prepare_send_request()
3176 msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); in __prepare_send_request()
3184 msg = create_request_message(session, req, drop_cap_releases); in __prepare_send_request()
3185 if (IS_ERR(msg)) { in __prepare_send_request()
3186 req->r_err = PTR_ERR(msg); in __prepare_send_request()
3187 return PTR_ERR(msg); in __prepare_send_request()
3189 req->r_request = msg; in __prepare_send_request()
3191 lhead = find_legacy_request_head(msg->front.iov_base, in __prepare_send_request()
3204 nhead = (struct ceph_mds_request_head*)msg->front.iov_base; in __prepare_send_request()
3628 static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) in handle_reply() argument
3632 struct ceph_mds_reply_head *head = msg->front.iov_base; in handle_reply()
3640 if (msg->front.iov_len < sizeof(*head)) { in handle_reply()
3642 ceph_msg_dump(msg); in handle_reply()
3647 tid = le64_to_cpu(msg->hdr.tid); in handle_reply()
3711 err = parse_reply_info(session, msg, req, (u64)-1); in handle_reply()
3713 err = parse_reply_info(session, msg, req, in handle_reply()
3750 ceph_msg_dump(msg); in handle_reply()
3766 ceph_msg_dump(msg); in handle_reply()
3809 req->r_reply = ceph_msg_get(msg); in handle_reply()
3840 struct ceph_msg *msg) in handle_forward() argument
3843 u64 tid = le64_to_cpu(msg->hdr.tid); in handle_forward()
3847 void *p = msg->front.iov_base; in handle_forward()
3848 void *end = p + msg->front.iov_len; in handle_forward()
3902 ceph_msg_dump(msg); in handle_forward()
3937 struct ceph_msg *msg) in handle_session() argument
3941 int msg_version = le16_to_cpu(msg->hdr.version); in handle_session()
3942 void *p = msg->front.iov_base; in handle_session()
3943 void *end = p + msg->front.iov_len; in handle_session()
4116 (int)msg->front.iov_len); in handle_session()
4117 ceph_msg_dump(msg); in handle_session()
4899 struct ceph_msg *msg) in handle_lease() argument
4906 struct ceph_mds_lease *h = msg->front.iov_base; in handle_lease()
4918 if (msg->front.iov_len < sizeof(*h) + sizeof(u32)) in handle_lease()
4924 if (msg->front.iov_len < sizeof(*h) + sizeof(u32) + dname.len) in handle_lease()
4990 ceph_msg_get(msg); in handle_lease()
4991 ceph_con_send(&session->s_con, msg); in handle_lease()
5004 ceph_msg_dump(msg); in handle_lease()
5011 struct ceph_msg *msg; in ceph_mdsc_lease_send_msg() local
5019 msg = ceph_msg_new(CEPH_MSG_CLIENT_LEASE, len, GFP_NOFS, false); in ceph_mdsc_lease_send_msg()
5020 if (!msg) in ceph_mdsc_lease_send_msg()
5022 lease = msg->front.iov_base; in ceph_mdsc_lease_send_msg()
5036 ceph_con_send(&session->s_con, msg); in ceph_mdsc_lease_send_msg()
5286 struct ceph_msg *msg; in send_flush_mdlog() local
5297 msg = ceph_create_session_msg(CEPH_SESSION_REQUEST_FLUSH_MDLOG, in send_flush_mdlog()
5299 if (!msg) { in send_flush_mdlog()
5303 ceph_con_send(&s->s_con, msg); in send_flush_mdlog()
5571 void ceph_mdsc_handle_fsmap(struct ceph_mds_client *mdsc, struct ceph_msg *msg) in ceph_mdsc_handle_fsmap() argument
5575 void *p = msg->front.iov_base; in ceph_mdsc_handle_fsmap()
5576 void *end = p + msg->front.iov_len; in ceph_mdsc_handle_fsmap()
5632 ceph_msg_dump(msg); in ceph_mdsc_handle_fsmap()
5643 void ceph_mdsc_handle_mdsmap(struct ceph_mds_client *mdsc, struct ceph_msg *msg) in ceph_mdsc_handle_mdsmap() argument
5647 void *p = msg->front.iov_base; in ceph_mdsc_handle_mdsmap()
5648 void *end = p + msg->front.iov_len; in ceph_mdsc_handle_mdsmap()
5701 ceph_msg_dump(msg); in ceph_mdsc_handle_mdsmap()
5735 static void mds_dispatch(struct ceph_connection *con, struct ceph_msg *msg) in mds_dispatch() argument
5739 int type = le16_to_cpu(msg->hdr.type); in mds_dispatch()
5750 ceph_mdsc_handle_mdsmap(mdsc, msg); in mds_dispatch()
5753 ceph_mdsc_handle_fsmap(mdsc, msg); in mds_dispatch()
5756 handle_session(s, msg); in mds_dispatch()
5759 handle_reply(s, msg); in mds_dispatch()
5762 handle_forward(mdsc, s, msg); in mds_dispatch()
5765 ceph_handle_caps(s, msg); in mds_dispatch()
5768 ceph_handle_snap(mdsc, s, msg); in mds_dispatch()
5771 handle_lease(mdsc, s, msg); in mds_dispatch()
5774 ceph_handle_quota(mdsc, s, msg); in mds_dispatch()
5782 ceph_msg_put(msg); in mds_dispatch()
5921 struct ceph_msg *msg; in mds_alloc_msg() local
5929 msg = ceph_msg_new(type, front_len, GFP_NOFS, false); in mds_alloc_msg()
5930 if (!msg) { in mds_alloc_msg()
5936 return msg; in mds_alloc_msg()
5939 static int mds_sign_message(struct ceph_msg *msg) in mds_sign_message() argument
5941 struct ceph_mds_session *s = msg->con->private; in mds_sign_message()
5944 return ceph_auth_sign_message(auth, msg); in mds_sign_message()
5947 static int mds_check_message_signature(struct ceph_msg *msg) in mds_check_message_signature() argument
5949 struct ceph_mds_session *s = msg->con->private; in mds_check_message_signature()
5952 return ceph_auth_check_message_signature(auth, msg); in mds_check_message_signature()