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);
1074 int ctrl_len = con->v2.in_desc.fd_lens[0];
1075 int rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN;
1207 * control body (ctrl_len bytes)
1216 * control body (ctrl_len + extdata_len bytes)
1222 int ctrl_len, void *extdata, int extdata_len,
1225 int base_len = CEPH_PREAMBLE_LEN + ctrl_len + CEPH_CRC_LEN;
1229 crc = crc32c(-1, CTRL_BODY(base), ctrl_len);
1252 void *base, int ctrl_len)
1258 if (ctrl_len < CEPH_PREAMBLE_INLINE_LEN)
1259 memset(CTRL_BODY(base) + ctrl_len, 0,
1260 CEPH_PREAMBLE_INLINE_LEN - ctrl_len);
1275 * control body (ctrl_len bytes)
1286 * control body (ctrl_len - 48 bytes)
1293 void *base, int ctrl_len)
1295 int rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN;
1325 void *base, int ctrl_len, void *extdata,
1328 int total_len = ctrl_len + extdata_len;
1333 total_len, ctrl_len, extdata_len);
1336 if (WARN_ON(is_vmalloc_addr(base) || !ctrl_len))
1346 if (ctrl_len <= CEPH_PREAMBLE_INLINE_LEN)
1348 ret = prepare_head_secure_small(con, base, ctrl_len);
1351 ret = prepare_head_secure_big(con, base, ctrl_len);
1355 prepare_head_plain(con, base, ctrl_len, extdata, extdata_len,
1364 void *base, int ctrl_len)
1366 return __prepare_control(con, tag, base, ctrl_len, NULL, 0, false);
1372 int ctrl_len;
1374 ctrl_len = 1 + ceph_entity_addr_encoding_len(&con->peer_addr);
1375 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, false));
1382 WARN_ON(p != CTRL_BODY(buf) + ctrl_len);
1384 return __prepare_control(con, FRAME_TAG_HELLO, buf, ctrl_len,
1394 int ctrl_len, authorizer_len;
1398 ctrl_len = AUTH_BUF_LEN;
1399 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, false));
1404 ret = con->ops->get_auth_request(con, CTRL_BODY(buf), &ctrl_len,
1423 return __prepare_control(con, FRAME_TAG_AUTH_REQUEST, buf, ctrl_len,
1430 int ctrl_len, authorizer_len;
1435 ctrl_len = AUTH_BUF_LEN;
1436 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, false));
1442 CTRL_BODY(buf), &ctrl_len,
1456 ctrl_len, authorizer, authorizer_len, true);
1484 int ctrl_len;
1508 ctrl_len = 1 + 4 + ceph_entity_addr_encoding_len(my_addr) +
1510 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, con_secure(con)));
1525 WARN_ON(p != CTRL_BODY(buf) + ctrl_len);
1527 return prepare_control(con, FRAME_TAG_CLIENT_IDENT, buf, ctrl_len);
1534 int ctrl_len;
1546 ctrl_len = 1 + 4 + ceph_entity_addr_encoding_len(my_addr) + 5 * 8;
1547 buf = alloc_conn_buf(con, head_onwire_len(ctrl_len, con_secure(con)));
1560 WARN_ON(p != CTRL_BODY(buf) + ctrl_len);
1562 return prepare_control(con, FRAME_TAG_SESSION_RECONNECT, buf, ctrl_len);
1810 int ctrl_len = con->v2.in_desc.fd_lens[0];
1817 head_len = head_onwire_len(ctrl_len, false);
1825 add_in_kvec(con, CTRL_BODY(buf), ctrl_len);
1826 add_in_kvec(con, CTRL_BODY(buf) + ctrl_len, CEPH_CRC_LEN);
1829 if (ctrl_len > CEPH_PREAMBLE_INLINE_LEN) {
1830 buf = alloc_conn_buf(con, ctrl_len);
1834 add_in_kvec(con, buf, ctrl_len);
1836 add_in_kvec(con, CTRL_BODY(con->v2.in_buf), ctrl_len);
1846 int ctrl_len = con->v2.in_desc.fd_lens[0];
1847 int rem_len = ctrl_len - CEPH_PREAMBLE_INLINE_LEN;
1850 buf = alloc_conn_buf(con, ctrl_len);
2998 int ctrl_len = con->v2.in_desc.fd_lens[0];
3011 buf = alloc_conn_buf(con, ctrl_len);
3015 memcpy(buf, con->v2.in_kvecs[0].iov_base, ctrl_len);