Lines Matching refs:ctrl_len
390 static int head_onwire_len(int ctrl_len, bool secure)
395 BUG_ON(ctrl_len < 0 || ctrl_len > CEPH_MSG_MAX_CONTROL_LEN);
399 if (ctrl_len > CEPH_PREAMBLE_INLINE_LEN) {
400 rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN;
405 if (ctrl_len)
406 head_len += ctrl_len + CEPH_CRC_LEN;
641 int ctrl_len = con->v2.in_desc.fd_lens[0];
644 WARN_ON(con->v2.in_kvecs[0].iov_len != ctrl_len);
647 crc = crc32c(-1, con->v2.in_kvecs[0].iov_base, ctrl_len);
1070 int ctrl_len = con->v2.in_desc.fd_lens[0];
1071 int rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN;
1203 * control body (ctrl_len bytes)
1212 * control body (ctrl_len + extdata_len bytes)
1218 int ctrl_len, void *extdata, int extdata_len,
1221 int base_len = CEPH_PREAMBLE_LEN + ctrl_len + CEPH_CRC_LEN;
1225 crc = crc32c(-1, CTRL_BODY(base), ctrl_len);
1248 void *base, int ctrl_len)
1254 if (ctrl_len < CEPH_PREAMBLE_INLINE_LEN)
1255 memset(CTRL_BODY(base) + ctrl_len, 0,
1256 CEPH_PREAMBLE_INLINE_LEN - ctrl_len);
1271 * control body (ctrl_len bytes)
1282 * control body (ctrl_len - 48 bytes)
1289 void *base, int ctrl_len)
1291 int rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN;
1321 void *base, int ctrl_len, void *extdata,
1324 int total_len = ctrl_len + extdata_len;
1329 total_len, ctrl_len, extdata_len);
1332 if (WARN_ON(is_vmalloc_addr(base) || !ctrl_len))
1342 if (ctrl_len <= CEPH_PREAMBLE_INLINE_LEN)
1344 ret = prepare_head_secure_small(con, base, ctrl_len);
1347 ret = prepare_head_secure_big(con, base, ctrl_len);
1351 prepare_head_plain(con, base, ctrl_len, extdata, extdata_len,
1360 void *base, int ctrl_len)
1362 return __prepare_control(con, tag, base, ctrl_len, NULL, 0, false);
1368 int ctrl_len;
1370 ctrl_len = 1 + ceph_entity_addr_encoding_len(&con->peer_addr);
1371 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, false));
1378 WARN_ON(p != CTRL_BODY(buf) + ctrl_len);
1380 return __prepare_control(con, FRAME_TAG_HELLO, buf, ctrl_len,
1390 int ctrl_len, authorizer_len;
1394 ctrl_len = AUTH_BUF_LEN;
1395 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, false));
1400 ret = con->ops->get_auth_request(con, CTRL_BODY(buf), &ctrl_len,
1419 return __prepare_control(con, FRAME_TAG_AUTH_REQUEST, buf, ctrl_len,
1426 int ctrl_len, authorizer_len;
1431 ctrl_len = AUTH_BUF_LEN;
1432 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, false));
1438 CTRL_BODY(buf), &ctrl_len,
1452 ctrl_len, authorizer, authorizer_len, true);
1480 int ctrl_len;
1504 ctrl_len = 1 + 4 + ceph_entity_addr_encoding_len(my_addr) +
1506 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, con_secure(con)));
1521 WARN_ON(p != CTRL_BODY(buf) + ctrl_len);
1523 return prepare_control(con, FRAME_TAG_CLIENT_IDENT, buf, ctrl_len);
1530 int ctrl_len;
1542 ctrl_len = 1 + 4 + ceph_entity_addr_encoding_len(my_addr) + 5 * 8;
1543 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, con_secure(con)));
1556 WARN_ON(p != CTRL_BODY(buf) + ctrl_len);
1558 return prepare_control(con, FRAME_TAG_SESSION_RECONNECT, buf, ctrl_len);
1806 int ctrl_len = con->v2.in_desc.fd_lens[0];
1813 head_len = head_onwire_len(ctrl_len, false);
1821 add_in_kvec(con, CTRL_BODY(buf), ctrl_len);
1822 add_in_kvec(con, CTRL_BODY(buf) + ctrl_len, CEPH_CRC_LEN);
1825 if (ctrl_len > CEPH_PREAMBLE_INLINE_LEN) {
1826 buf = alloc_conn_buf(con, ctrl_len);
1830 add_in_kvec(con, buf, ctrl_len);
1832 add_in_kvec(con, CTRL_BODY(con->v2.in_buf), ctrl_len);
1842 int ctrl_len = con->v2.in_desc.fd_lens[0];
1843 int rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN;
1846 buf = alloc_conn_buf(con, ctrl_len);
2997 int ctrl_len = con->v2.in_desc.fd_lens[0];
3010 buf = alloc_conn_buf(con, ctrl_len);
3014 memcpy(buf, con->v2.in_kvecs[0].iov_base, ctrl_len);