Lines Matching refs:msg
290 static int parse_reply_info(struct ceph_msg *msg, in parse_reply_info() argument
298 info->head = msg->front.iov_base; in parse_reply_info()
299 p = msg->front.iov_base + sizeof(struct ceph_mds_reply_head); in parse_reply_info()
300 end = p + msg->front.iov_len - sizeof(struct ceph_mds_reply_head); in parse_reply_info()
817 struct ceph_msg *msg; in create_session_msg() local
820 msg = ceph_msg_new(CEPH_MSG_CLIENT_SESSION, sizeof(*h), GFP_NOFS, in create_session_msg()
822 if (!msg) { in create_session_msg()
826 h = msg->front.iov_base; in create_session_msg()
830 return msg; in create_session_msg()
839 struct ceph_msg *msg; in create_session_open_msg() local
863 msg = ceph_msg_new(CEPH_MSG_CLIENT_SESSION, sizeof(*h) + metadata_bytes, in create_session_open_msg()
865 if (!msg) { in create_session_open_msg()
869 h = msg->front.iov_base; in create_session_open_msg()
879 msg->hdr.version = cpu_to_le16(2); in create_session_open_msg()
880 msg->hdr.compat_version = cpu_to_le16(1); in create_session_open_msg()
883 p = msg->front.iov_base + sizeof(*h); in create_session_open_msg()
901 return msg; in create_session_open_msg()
912 struct ceph_msg *msg; in __open_session() local
924 msg = create_session_open_msg(mdsc, session->s_seq); in __open_session()
925 if (!msg) in __open_session()
927 ceph_con_send(&session->s_con, msg); in __open_session()
1006 struct ceph_msg *msg; in cleanup_cap_releases() local
1010 msg = list_first_entry(&session->s_cap_releases, in cleanup_cap_releases()
1012 list_del_init(&msg->list_head); in cleanup_cap_releases()
1013 ceph_msg_put(msg); in cleanup_cap_releases()
1016 msg = list_first_entry(&session->s_cap_releases_done, in cleanup_cap_releases()
1018 list_del_init(&msg->list_head); in cleanup_cap_releases()
1019 ceph_msg_put(msg); in cleanup_cap_releases()
1239 struct ceph_msg *msg; in send_renew_caps() local
1258 msg = create_session_msg(CEPH_SESSION_REQUEST_RENEWCAPS, in send_renew_caps()
1260 if (!msg) in send_renew_caps()
1262 ceph_con_send(&session->s_con, msg); in send_renew_caps()
1269 struct ceph_msg *msg; in send_flushmsg_ack() local
1273 msg = create_session_msg(CEPH_SESSION_FLUSHMSG_ACK, seq); in send_flushmsg_ack()
1274 if (!msg) in send_flushmsg_ack()
1276 ceph_con_send(&session->s_con, msg); in send_flushmsg_ack()
1321 struct ceph_msg *msg; in request_close_session() local
1326 msg = create_session_msg(CEPH_SESSION_REQUEST_CLOSE, session->s_seq); in request_close_session()
1327 if (!msg) in request_close_session()
1329 ceph_con_send(&session->s_con, msg); in request_close_session()
1435 struct ceph_msg *msg, *partial = NULL; in ceph_add_cap_releases() local
1447 msg = list_first_entry(&session->s_cap_releases, in ceph_add_cap_releases()
1450 head = msg->front.iov_base; in ceph_add_cap_releases()
1453 dout(" partial %p with (%d/%d)\n", msg, num, in ceph_add_cap_releases()
1456 partial = msg; in ceph_add_cap_releases()
1461 msg = ceph_msg_new(CEPH_MSG_CLIENT_CAPRELEASE, PAGE_CACHE_SIZE, in ceph_add_cap_releases()
1463 if (!msg) in ceph_add_cap_releases()
1465 dout("add_cap_releases %p msg %p now %d\n", session, msg, in ceph_add_cap_releases()
1466 (int)msg->front.iov_len); in ceph_add_cap_releases()
1467 head = msg->front.iov_base; in ceph_add_cap_releases()
1469 msg->front.iov_len = sizeof(*head); in ceph_add_cap_releases()
1471 list_add(&msg->list_head, &session->s_cap_releases); in ceph_add_cap_releases()
1560 struct ceph_msg *msg; in ceph_send_cap_releases() local
1565 msg = list_first_entry(&session->s_cap_releases_done, in ceph_send_cap_releases()
1567 list_del_init(&msg->list_head); in ceph_send_cap_releases()
1569 msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); in ceph_send_cap_releases()
1570 dout("send_cap_releases mds%d %p\n", session->s_mds, msg); in ceph_send_cap_releases()
1571 ceph_con_send(&session->s_con, msg); in ceph_send_cap_releases()
1580 struct ceph_msg *msg; in discard_cap_releases() local
1588 msg = list_first_entry(&session->s_cap_releases, in discard_cap_releases()
1590 head = msg->front.iov_base; in discard_cap_releases()
1593 session->s_mds, msg, num); in discard_cap_releases()
1595 msg->front.iov_len = sizeof(*head); in discard_cap_releases()
1601 msg = list_first_entry(&session->s_cap_releases_done, in discard_cap_releases()
1603 list_del_init(&msg->list_head); in discard_cap_releases()
1605 head = msg->front.iov_base; in discard_cap_releases()
1607 dout("discard_cap_releases mds%d %p %u\n", session->s_mds, msg, in discard_cap_releases()
1611 msg->front.iov_len = sizeof(*head); in discard_cap_releases()
1612 list_add(&msg->list_head, &session->s_cap_releases); in discard_cap_releases()
1878 struct ceph_msg *msg; in create_request_message() local
1894 msg = ERR_PTR(ret); in create_request_message()
1902 msg = ERR_PTR(ret); in create_request_message()
1919 msg = ceph_msg_new(CEPH_MSG_CLIENT_REQUEST, len, GFP_NOFS, false); in create_request_message()
1920 if (!msg) { in create_request_message()
1921 msg = ERR_PTR(-ENOMEM); in create_request_message()
1925 msg->hdr.version = cpu_to_le16(2); in create_request_message()
1926 msg->hdr.tid = cpu_to_le64(req->r_tid); in create_request_message()
1928 head = msg->front.iov_base; in create_request_message()
1929 p = msg->front.iov_base + sizeof(*head); in create_request_message()
1930 end = msg->front.iov_base + msg->front.iov_len; in create_request_message()
1942 req->r_request_release_offset = p - msg->front.iov_base; in create_request_message()
1963 p = msg->front.iov_base + req->r_request_release_offset; in create_request_message()
1976 msg->front.iov_len = p - msg->front.iov_base; in create_request_message()
1977 msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); in create_request_message()
1982 ceph_msg_data_add_pagelist(msg, pagelist); in create_request_message()
1983 msg->hdr.data_len = cpu_to_le32(pagelist->length); in create_request_message()
1985 msg->hdr.data_len = 0; in create_request_message()
1988 msg->hdr.data_off = cpu_to_le16(0); in create_request_message()
1997 return msg; in create_request_message()
2021 struct ceph_msg *msg; in __prepare_send_request() local
2045 msg = req->r_request; in __prepare_send_request()
2046 rhead = msg->front.iov_base; in __prepare_send_request()
2061 p = msg->front.iov_base + req->r_request_release_offset; in __prepare_send_request()
2068 msg->front.iov_len = p - msg->front.iov_base; in __prepare_send_request()
2069 msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); in __prepare_send_request()
2077 msg = create_request_message(mdsc, req, mds, drop_cap_releases); in __prepare_send_request()
2078 if (IS_ERR(msg)) { in __prepare_send_request()
2079 req->r_err = PTR_ERR(msg); in __prepare_send_request()
2081 return PTR_ERR(msg); in __prepare_send_request()
2083 req->r_request = msg; in __prepare_send_request()
2085 rhead = msg->front.iov_base; in __prepare_send_request()
2336 static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) in handle_reply() argument
2340 struct ceph_mds_reply_head *head = msg->front.iov_base; in handle_reply()
2347 if (msg->front.iov_len < sizeof(*head)) { in handle_reply()
2349 ceph_msg_dump(msg); in handle_reply()
2354 tid = le64_to_cpu(msg->hdr.tid); in handle_reply()
2447 err = parse_reply_info(msg, rinfo, session->s_con.peer_features); in handle_reply()
2453 ceph_msg_dump(msg); in handle_reply()
2490 req->r_reply = msg; in handle_reply()
2491 ceph_msg_get(msg); in handle_reply()
2516 struct ceph_msg *msg) in handle_forward() argument
2519 u64 tid = le64_to_cpu(msg->hdr.tid); in handle_forward()
2523 void *p = msg->front.iov_base; in handle_forward()
2524 void *end = p + msg->front.iov_len; in handle_forward()
2567 struct ceph_msg *msg) in handle_session() argument
2573 struct ceph_mds_session_head *h = msg->front.iov_base; in handle_session()
2577 if (msg->front.iov_len != sizeof(*h)) in handle_session()
2668 (int)msg->front.iov_len); in handle_session()
2669 ceph_msg_dump(msg); in handle_session()
3094 struct ceph_msg *msg) in handle_lease() argument
3101 struct ceph_mds_lease *h = msg->front.iov_base; in handle_lease()
3110 if (msg->front.iov_len < sizeof(*h) + sizeof(u32)) in handle_lease()
3116 dname.len = msg->front.iov_len - sizeof(*h) - sizeof(u32); in handle_lease()
3184 ceph_msg_get(msg); in handle_lease()
3185 ceph_con_send(&session->s_con, msg); in handle_lease()
3194 ceph_msg_dump(msg); in handle_lease()
3202 struct ceph_msg *msg; in ceph_mdsc_lease_send_msg() local
3212 msg = ceph_msg_new(CEPH_MSG_CLIENT_LEASE, len, GFP_NOFS, false); in ceph_mdsc_lease_send_msg()
3213 if (!msg) in ceph_mdsc_lease_send_msg()
3215 lease = msg->front.iov_base; in ceph_mdsc_lease_send_msg()
3228 msg->more_to_follow = (action == CEPH_MDS_LEASE_RELEASE); in ceph_mdsc_lease_send_msg()
3230 ceph_con_send(&session->s_con, msg); in ceph_mdsc_lease_send_msg()
3631 void ceph_mdsc_handle_map(struct ceph_mds_client *mdsc, struct ceph_msg *msg) in ceph_mdsc_handle_map() argument
3635 void *p = msg->front.iov_base; in ceph_mdsc_handle_map()
3636 void *end = p + msg->front.iov_len; in ceph_mdsc_handle_map()
3722 static void dispatch(struct ceph_connection *con, struct ceph_msg *msg) in dispatch() argument
3726 int type = le16_to_cpu(msg->hdr.type); in dispatch()
3737 ceph_mdsc_handle_map(mdsc, msg); in dispatch()
3740 handle_session(s, msg); in dispatch()
3743 handle_reply(s, msg); in dispatch()
3746 handle_forward(mdsc, s, msg); in dispatch()
3749 ceph_handle_caps(s, msg); in dispatch()
3752 ceph_handle_snap(mdsc, s, msg); in dispatch()
3755 handle_lease(mdsc, s, msg); in dispatch()
3763 ceph_msg_put(msg); in dispatch()
3826 struct ceph_msg *msg; in mds_alloc_msg() local
3834 msg = ceph_msg_new(type, front_len, GFP_NOFS, false); in mds_alloc_msg()
3835 if (!msg) { in mds_alloc_msg()
3841 return msg; in mds_alloc_msg()
3844 static int sign_message(struct ceph_connection *con, struct ceph_msg *msg) in sign_message() argument
3848 return ceph_auth_sign_message(auth, msg); in sign_message()
3851 static int check_message_signature(struct ceph_connection *con, struct ceph_msg *msg) in check_message_signature() argument
3855 return ceph_auth_check_message_signature(auth, msg); in check_message_signature()