Lines Matching refs:ctrl_len

390 static int head_onwire_len(int ctrl_len, bool secure)  in head_onwire_len()  argument
397 if (ctrl_len > CEPH_PREAMBLE_INLINE_LEN) { in head_onwire_len()
398 rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN; in head_onwire_len()
403 if (ctrl_len) in head_onwire_len()
404 head_len += ctrl_len + CEPH_CRC_LEN; in head_onwire_len()
630 int ctrl_len = con->v2.in_desc.fd_lens[0]; in verify_control_crc() local
633 WARN_ON(con->v2.in_kvecs[0].iov_len != ctrl_len); in verify_control_crc()
636 crc = crc32c(-1, con->v2.in_kvecs[0].iov_base, ctrl_len); in verify_control_crc()
1020 int ctrl_len = con->v2.in_desc.fd_lens[0]; in decrypt_control_remainder() local
1021 int rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN; in decrypt_control_remainder()
1114 int ctrl_len, void *extdata, int extdata_len, in prepare_head_plain() argument
1117 int base_len = CEPH_PREAMBLE_LEN + ctrl_len + CEPH_CRC_LEN; in prepare_head_plain()
1121 crc = crc32c(-1, CTRL_BODY(base), ctrl_len); in prepare_head_plain()
1144 void *base, int ctrl_len) in prepare_head_secure_small() argument
1150 if (ctrl_len < CEPH_PREAMBLE_INLINE_LEN) in prepare_head_secure_small()
1151 memset(CTRL_BODY(base) + ctrl_len, 0, in prepare_head_secure_small()
1152 CEPH_PREAMBLE_INLINE_LEN - ctrl_len); in prepare_head_secure_small()
1185 void *base, int ctrl_len) in prepare_head_secure_big() argument
1187 int rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN; in prepare_head_secure_big()
1217 void *base, int ctrl_len, void *extdata, in __prepare_control() argument
1220 int total_len = ctrl_len + extdata_len; in __prepare_control()
1225 total_len, ctrl_len, extdata_len); in __prepare_control()
1228 if (WARN_ON(is_vmalloc_addr(base) || !ctrl_len)) in __prepare_control()
1238 if (ctrl_len <= CEPH_PREAMBLE_INLINE_LEN) in __prepare_control()
1240 ret = prepare_head_secure_small(con, base, ctrl_len); in __prepare_control()
1243 ret = prepare_head_secure_big(con, base, ctrl_len); in __prepare_control()
1247 prepare_head_plain(con, base, ctrl_len, extdata, extdata_len, in __prepare_control()
1256 void *base, int ctrl_len) in prepare_control() argument
1258 return __prepare_control(con, tag, base, ctrl_len, NULL, 0, false); in prepare_control()
1264 int ctrl_len; in prepare_hello() local
1266 ctrl_len = 1 + ceph_entity_addr_encoding_len(&con->peer_addr); in prepare_hello()
1267 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, false)); in prepare_hello()
1274 WARN_ON(p != CTRL_BODY(buf) + ctrl_len); in prepare_hello()
1276 return __prepare_control(con, FRAME_TAG_HELLO, buf, ctrl_len, in prepare_hello()
1286 int ctrl_len, authorizer_len; in prepare_auth_request() local
1290 ctrl_len = AUTH_BUF_LEN; in prepare_auth_request()
1291 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, false)); in prepare_auth_request()
1296 ret = con->ops->get_auth_request(con, CTRL_BODY(buf), &ctrl_len, in prepare_auth_request()
1315 return __prepare_control(con, FRAME_TAG_AUTH_REQUEST, buf, ctrl_len, in prepare_auth_request()
1322 int ctrl_len, authorizer_len; in prepare_auth_request_more() local
1327 ctrl_len = AUTH_BUF_LEN; in prepare_auth_request_more()
1328 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, false)); in prepare_auth_request_more()
1334 CTRL_BODY(buf), &ctrl_len, in prepare_auth_request_more()
1348 ctrl_len, authorizer, authorizer_len, true); in prepare_auth_request_more()
1376 int ctrl_len; in prepare_client_ident() local
1400 ctrl_len = 1 + 4 + ceph_entity_addr_encoding_len(my_addr) + in prepare_client_ident()
1402 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, con_secure(con))); in prepare_client_ident()
1417 WARN_ON(p != CTRL_BODY(buf) + ctrl_len); in prepare_client_ident()
1419 return prepare_control(con, FRAME_TAG_CLIENT_IDENT, buf, ctrl_len); in prepare_client_ident()
1426 int ctrl_len; in prepare_session_reconnect() local
1438 ctrl_len = 1 + 4 + ceph_entity_addr_encoding_len(my_addr) + 5 * 8; in prepare_session_reconnect()
1439 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, con_secure(con))); in prepare_session_reconnect()
1452 WARN_ON(p != CTRL_BODY(buf) + ctrl_len); in prepare_session_reconnect()
1454 return prepare_control(con, FRAME_TAG_SESSION_RECONNECT, buf, ctrl_len); in prepare_session_reconnect()
1702 int ctrl_len = con->v2.in_desc.fd_lens[0]; in prepare_read_control() local
1709 head_len = head_onwire_len(ctrl_len, false); in prepare_read_control()
1717 add_in_kvec(con, CTRL_BODY(buf), ctrl_len); in prepare_read_control()
1718 add_in_kvec(con, CTRL_BODY(buf) + ctrl_len, CEPH_CRC_LEN); in prepare_read_control()
1721 if (ctrl_len > CEPH_PREAMBLE_INLINE_LEN) { in prepare_read_control()
1722 buf = alloc_conn_buf(con, ctrl_len); in prepare_read_control()
1726 add_in_kvec(con, buf, ctrl_len); in prepare_read_control()
1728 add_in_kvec(con, CTRL_BODY(con->v2.in_buf), ctrl_len); in prepare_read_control()
1738 int ctrl_len = con->v2.in_desc.fd_lens[0]; in prepare_read_control_remainder() local
1739 int rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN; in prepare_read_control_remainder()
1742 buf = alloc_conn_buf(con, ctrl_len); in prepare_read_control_remainder()
2771 int ctrl_len = con->v2.in_desc.fd_lens[0]; in handle_control() local
2784 buf = alloc_conn_buf(con, ctrl_len); in handle_control()
2788 memcpy(buf, con->v2.in_kvecs[0].iov_base, ctrl_len); in handle_control()