Lines Matching refs:ctrl_len

389 static int head_onwire_len(int ctrl_len, bool secure)  in head_onwire_len()  argument
396 if (ctrl_len > CEPH_PREAMBLE_INLINE_LEN) { in head_onwire_len()
397 rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN; in head_onwire_len()
402 if (ctrl_len) in head_onwire_len()
403 head_len += ctrl_len + CEPH_CRC_LEN; in head_onwire_len()
629 int ctrl_len = con->v2.in_desc.fd_lens[0]; in verify_control_crc() local
632 WARN_ON(con->v2.in_kvecs[0].iov_len != ctrl_len); in verify_control_crc()
635 crc = crc32c(-1, con->v2.in_kvecs[0].iov_base, ctrl_len); in verify_control_crc()
1019 int ctrl_len = con->v2.in_desc.fd_lens[0]; in decrypt_control_remainder() local
1020 int rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN; in decrypt_control_remainder()
1094 int ctrl_len, void *extdata, int extdata_len, in prepare_head_plain() argument
1097 int base_len = CEPH_PREAMBLE_LEN + ctrl_len + CEPH_CRC_LEN; in prepare_head_plain()
1101 crc = crc32c(-1, CTRL_BODY(base), ctrl_len); in prepare_head_plain()
1124 void *base, int ctrl_len) in prepare_head_secure_small() argument
1130 if (ctrl_len < CEPH_PREAMBLE_INLINE_LEN) in prepare_head_secure_small()
1131 memset(CTRL_BODY(base) + ctrl_len, 0, in prepare_head_secure_small()
1132 CEPH_PREAMBLE_INLINE_LEN - ctrl_len); in prepare_head_secure_small()
1165 void *base, int ctrl_len) in prepare_head_secure_big() argument
1167 int rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN; in prepare_head_secure_big()
1197 void *base, int ctrl_len, void *extdata, in __prepare_control() argument
1200 int total_len = ctrl_len + extdata_len; in __prepare_control()
1205 total_len, ctrl_len, extdata_len); in __prepare_control()
1208 if (WARN_ON(is_vmalloc_addr(base) || !ctrl_len)) in __prepare_control()
1218 if (ctrl_len <= CEPH_PREAMBLE_INLINE_LEN) in __prepare_control()
1220 ret = prepare_head_secure_small(con, base, ctrl_len); in __prepare_control()
1223 ret = prepare_head_secure_big(con, base, ctrl_len); in __prepare_control()
1227 prepare_head_plain(con, base, ctrl_len, extdata, extdata_len, in __prepare_control()
1236 void *base, int ctrl_len) in prepare_control() argument
1238 return __prepare_control(con, tag, base, ctrl_len, NULL, 0, false); in prepare_control()
1244 int ctrl_len; in prepare_hello() local
1246 ctrl_len = 1 + ceph_entity_addr_encoding_len(&con->peer_addr); in prepare_hello()
1247 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, false)); in prepare_hello()
1254 WARN_ON(p != CTRL_BODY(buf) + ctrl_len); in prepare_hello()
1256 return __prepare_control(con, FRAME_TAG_HELLO, buf, ctrl_len, in prepare_hello()
1266 int ctrl_len, authorizer_len; in prepare_auth_request() local
1270 ctrl_len = AUTH_BUF_LEN; in prepare_auth_request()
1271 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, false)); in prepare_auth_request()
1276 ret = con->ops->get_auth_request(con, CTRL_BODY(buf), &ctrl_len, in prepare_auth_request()
1295 return __prepare_control(con, FRAME_TAG_AUTH_REQUEST, buf, ctrl_len, in prepare_auth_request()
1302 int ctrl_len, authorizer_len; in prepare_auth_request_more() local
1307 ctrl_len = AUTH_BUF_LEN; in prepare_auth_request_more()
1308 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, false)); in prepare_auth_request_more()
1314 CTRL_BODY(buf), &ctrl_len, in prepare_auth_request_more()
1328 ctrl_len, authorizer, authorizer_len, true); in prepare_auth_request_more()
1356 int ctrl_len; in prepare_client_ident() local
1380 ctrl_len = 1 + 4 + ceph_entity_addr_encoding_len(my_addr) + in prepare_client_ident()
1382 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, con_secure(con))); in prepare_client_ident()
1397 WARN_ON(p != CTRL_BODY(buf) + ctrl_len); in prepare_client_ident()
1399 return prepare_control(con, FRAME_TAG_CLIENT_IDENT, buf, ctrl_len); in prepare_client_ident()
1406 int ctrl_len; in prepare_session_reconnect() local
1418 ctrl_len = 1 + 4 + ceph_entity_addr_encoding_len(my_addr) + 5 * 8; in prepare_session_reconnect()
1419 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, con_secure(con))); in prepare_session_reconnect()
1432 WARN_ON(p != CTRL_BODY(buf) + ctrl_len); in prepare_session_reconnect()
1434 return prepare_control(con, FRAME_TAG_SESSION_RECONNECT, buf, ctrl_len); in prepare_session_reconnect()
1682 int ctrl_len = con->v2.in_desc.fd_lens[0]; in prepare_read_control() local
1689 head_len = head_onwire_len(ctrl_len, false); in prepare_read_control()
1697 add_in_kvec(con, CTRL_BODY(buf), ctrl_len); in prepare_read_control()
1698 add_in_kvec(con, CTRL_BODY(buf) + ctrl_len, CEPH_CRC_LEN); in prepare_read_control()
1701 if (ctrl_len > CEPH_PREAMBLE_INLINE_LEN) { in prepare_read_control()
1702 buf = alloc_conn_buf(con, ctrl_len); in prepare_read_control()
1706 add_in_kvec(con, buf, ctrl_len); in prepare_read_control()
1708 add_in_kvec(con, CTRL_BODY(con->v2.in_buf), ctrl_len); in prepare_read_control()
1718 int ctrl_len = con->v2.in_desc.fd_lens[0]; in prepare_read_control_remainder() local
1719 int rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN; in prepare_read_control_remainder()
1722 buf = alloc_conn_buf(con, ctrl_len); in prepare_read_control_remainder()
2673 int ctrl_len = con->v2.in_desc.fd_lens[0]; in handle_control() local
2686 buf = alloc_conn_buf(con, ctrl_len); in handle_control()
2690 memcpy(buf, con->v2.in_kvecs[0].iov_base, ctrl_len); in handle_control()