Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libceph: pass the message pointer instead of loading con->out_msg

This pointer is in a register anyway, so let's use that instead of
reloading from memory everywhere.

[ idryomov: formatting ]

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

authored by

Max Kellermann and committed by
Ilya Dryomov
7399212d 59699a5a

+114 -107
+2 -2
include/linux/ceph/messenger.h
··· 555 555 /* messenger_v1.c */ 556 556 int ceph_con_v1_try_read(struct ceph_connection *con); 557 557 int ceph_con_v1_try_write(struct ceph_connection *con); 558 - void ceph_con_v1_revoke(struct ceph_connection *con); 558 + void ceph_con_v1_revoke(struct ceph_connection *con, struct ceph_msg *msg); 559 559 void ceph_con_v1_revoke_incoming(struct ceph_connection *con); 560 560 bool ceph_con_v1_opened(struct ceph_connection *con); 561 561 void ceph_con_v1_reset_session(struct ceph_connection *con); ··· 564 564 /* messenger_v2.c */ 565 565 int ceph_con_v2_try_read(struct ceph_connection *con); 566 566 int ceph_con_v2_try_write(struct ceph_connection *con); 567 - void ceph_con_v2_revoke(struct ceph_connection *con); 567 + void ceph_con_v2_revoke(struct ceph_connection *con, struct ceph_msg *msg); 568 568 void ceph_con_v2_revoke_incoming(struct ceph_connection *con); 569 569 bool ceph_con_v2_opened(struct ceph_connection *con); 570 570 void ceph_con_v2_reset_session(struct ceph_connection *con);
+2 -2
net/ceph/messenger.c
··· 1793 1793 WARN_ON(con->state != CEPH_CON_S_OPEN); 1794 1794 dout("%s con %p msg %p was sending\n", __func__, con, msg); 1795 1795 if (ceph_msgr2(from_msgr(con->msgr))) 1796 - ceph_con_v2_revoke(con); 1796 + ceph_con_v2_revoke(con, msg); 1797 1797 else 1798 - ceph_con_v1_revoke(con); 1798 + ceph_con_v1_revoke(con, msg); 1799 1799 ceph_msg_put(con->out_msg); 1800 1800 con->out_msg = NULL; 1801 1801 } else {
+22 -23
net/ceph/messenger_v1.c
··· 169 169 * Prepare footer for currently outgoing message, and finish things 170 170 * off. Assumes out_kvec* are already valid.. we just add on to the end. 171 171 */ 172 - static void prepare_write_message_footer(struct ceph_connection *con) 172 + static void prepare_write_message_footer(struct ceph_connection *con, 173 + struct ceph_msg *m) 173 174 { 174 - struct ceph_msg *m = con->out_msg; 175 - 176 175 m->footer.flags |= CEPH_MSG_FOOTER_COMPLETE; 177 176 178 177 dout("prepare_write_message_footer %p\n", con); ··· 229 230 230 231 /* fill in hdr crc and finalize hdr */ 231 232 crc = crc32c(0, &m->hdr, offsetof(struct ceph_msg_header, crc)); 232 - con->out_msg->hdr.crc = cpu_to_le32(crc); 233 - memcpy(&con->v1.out_hdr, &con->out_msg->hdr, sizeof(con->v1.out_hdr)); 233 + m->hdr.crc = cpu_to_le32(crc); 234 + memcpy(&con->v1.out_hdr, &m->hdr, sizeof(con->v1.out_hdr)); 234 235 235 236 /* fill in front and middle crc, footer */ 236 237 crc = crc32c(0, m->front.iov_base, m->front.iov_len); 237 - con->out_msg->footer.front_crc = cpu_to_le32(crc); 238 + m->footer.front_crc = cpu_to_le32(crc); 238 239 if (m->middle) { 239 240 crc = crc32c(0, m->middle->vec.iov_base, 240 241 m->middle->vec.iov_len); 241 - con->out_msg->footer.middle_crc = cpu_to_le32(crc); 242 + m->footer.middle_crc = cpu_to_le32(crc); 242 243 } else 243 - con->out_msg->footer.middle_crc = 0; 244 + m->footer.middle_crc = 0; 244 245 dout("%s front_crc %u middle_crc %u\n", __func__, 245 - le32_to_cpu(con->out_msg->footer.front_crc), 246 - le32_to_cpu(con->out_msg->footer.middle_crc)); 247 - con->out_msg->footer.flags = 0; 246 + le32_to_cpu(m->footer.front_crc), 247 + le32_to_cpu(m->footer.middle_crc)); 248 + m->footer.flags = 0; 248 249 249 250 /* is there a data payload? */ 250 - con->out_msg->footer.data_crc = 0; 251 + m->footer.data_crc = 0; 251 252 if (m->data_length) { 252 - prepare_message_data(con->out_msg, m->data_length); 253 + prepare_message_data(m, m->data_length); 253 254 con->v1.out_more = 1; /* data + footer will follow */ 254 255 } else { 255 256 /* no, queue up footer too and be done */ 256 - prepare_write_message_footer(con); 257 + prepare_write_message_footer(con, m); 257 258 } 258 259 259 260 ceph_con_flag_set(con, CEPH_CON_F_WRITE_PENDING); ··· 460 461 * 0 -> socket full, but more to do 461 462 * <0 -> error 462 463 */ 463 - static int write_partial_message_data(struct ceph_connection *con) 464 + static int write_partial_message_data(struct ceph_connection *con, 465 + struct ceph_msg *msg) 464 466 { 465 - struct ceph_msg *msg = con->out_msg; 466 467 struct ceph_msg_data_cursor *cursor = &msg->cursor; 467 468 bool do_datacrc = !ceph_test_opt(from_msgr(con->msgr), NOCRC); 468 469 u32 crc; ··· 514 515 else 515 516 msg->footer.flags |= CEPH_MSG_FOOTER_NOCRC; 516 517 con_out_kvec_reset(con); 517 - prepare_write_message_footer(con); 518 + prepare_write_message_footer(con, msg); 518 519 519 520 return 1; /* must return > 0 to indicate success */ 520 521 } ··· 1470 1471 */ 1471 1472 int ceph_con_v1_try_write(struct ceph_connection *con) 1472 1473 { 1474 + struct ceph_msg *msg; 1473 1475 int ret = 1; 1474 1476 1475 1477 dout("try_write start %p state %d\n", con, con->state); ··· 1517 1517 } 1518 1518 1519 1519 /* msg pages? */ 1520 - if (con->out_msg) { 1520 + msg = con->out_msg; 1521 + if (msg) { 1521 1522 if (con->v1.out_msg_done) { 1522 - ceph_msg_put(con->out_msg); 1523 + ceph_msg_put(msg); 1523 1524 con->out_msg = NULL; /* we're done with this one */ 1524 1525 goto do_next; 1525 1526 } 1526 1527 1527 - ret = write_partial_message_data(con); 1528 + ret = write_partial_message_data(con, msg); 1528 1529 if (ret == 1) 1529 1530 goto more; /* we need to send the footer, too! */ 1530 1531 if (ret == 0) ··· 1564 1563 return ret; 1565 1564 } 1566 1565 1567 - void ceph_con_v1_revoke(struct ceph_connection *con) 1566 + void ceph_con_v1_revoke(struct ceph_connection *con, struct ceph_msg *msg) 1568 1567 { 1569 - struct ceph_msg *msg = con->out_msg; 1570 - 1571 1568 WARN_ON(con->v1.out_skip); 1572 1569 /* footer */ 1573 1570 if (con->v1.out_msg_done) {
+88 -80
net/ceph/messenger_v2.c
··· 1560 1560 return prepare_control(con, FRAME_TAG_ACK, con->v2.out_buf, 8); 1561 1561 } 1562 1562 1563 - static void prepare_epilogue_plain(struct ceph_connection *con, bool aborted) 1563 + static void prepare_epilogue_plain(struct ceph_connection *con, 1564 + struct ceph_msg *msg, bool aborted) 1564 1565 { 1565 1566 dout("%s con %p msg %p aborted %d crcs %u %u %u\n", __func__, con, 1566 - con->out_msg, aborted, con->v2.out_epil.front_crc, 1567 + msg, aborted, con->v2.out_epil.front_crc, 1567 1568 con->v2.out_epil.middle_crc, con->v2.out_epil.data_crc); 1568 1569 1569 1570 encode_epilogue_plain(con, aborted); ··· 1575 1574 * For "used" empty segments, crc is -1. For unused (trailing) 1576 1575 * segments, crc is 0. 1577 1576 */ 1578 - static void prepare_message_plain(struct ceph_connection *con) 1577 + static void prepare_message_plain(struct ceph_connection *con, 1578 + struct ceph_msg *msg) 1579 1579 { 1580 - struct ceph_msg *msg = con->out_msg; 1581 - 1582 1580 prepare_head_plain(con, con->v2.out_buf, 1583 1581 sizeof(struct ceph_msg_header2), NULL, 0, false); 1584 1582 ··· 1618 1618 con->v2.out_state = OUT_S_QUEUE_DATA; 1619 1619 } else { 1620 1620 con->v2.out_epil.data_crc = 0; 1621 - prepare_epilogue_plain(con, false); 1621 + prepare_epilogue_plain(con, msg, false); 1622 1622 con->v2.out_state = OUT_S_FINISH_MESSAGE; 1623 1623 } 1624 1624 } ··· 1630 1630 * allocate pages for the entire tail of the message (currently up 1631 1631 * to ~32M) and two sgs arrays (up to ~256K each)... 1632 1632 */ 1633 - static int prepare_message_secure(struct ceph_connection *con) 1633 + static int prepare_message_secure(struct ceph_connection *con, 1634 + struct ceph_msg *msg) 1634 1635 { 1635 1636 void *zerop = page_address(ceph_zero_page); 1636 1637 struct sg_table enc_sgt = {}; ··· 1646 1645 if (ret) 1647 1646 return ret; 1648 1647 1649 - tail_len = tail_onwire_len(con->out_msg, true); 1648 + tail_len = tail_onwire_len(msg, true); 1650 1649 if (!tail_len) { 1651 1650 /* 1652 1651 * Empty message: once the head is written, ··· 1657 1656 } 1658 1657 1659 1658 encode_epilogue_secure(con, false); 1660 - ret = setup_message_sgs(&sgt, con->out_msg, zerop, zerop, zerop, 1659 + ret = setup_message_sgs(&sgt, msg, zerop, zerop, zerop, 1661 1660 &con->v2.out_epil, NULL, 0, false); 1662 1661 if (ret) 1663 1662 goto out; ··· 1686 1685 goto out; 1687 1686 1688 1687 dout("%s con %p msg %p sg_cnt %d enc_page_cnt %d\n", __func__, con, 1689 - con->out_msg, sgt.orig_nents, enc_page_cnt); 1688 + msg, sgt.orig_nents, enc_page_cnt); 1690 1689 con->v2.out_state = OUT_S_QUEUE_ENC_PAGE; 1691 1690 1692 1691 out: ··· 1695 1694 return ret; 1696 1695 } 1697 1696 1698 - static int prepare_message(struct ceph_connection *con) 1697 + static int prepare_message(struct ceph_connection *con, struct ceph_msg *msg) 1699 1698 { 1700 1699 int lens[] = { 1701 1700 sizeof(struct ceph_msg_header2), 1702 - front_len(con->out_msg), 1703 - middle_len(con->out_msg), 1704 - data_len(con->out_msg) 1701 + front_len(msg), 1702 + middle_len(msg), 1703 + data_len(msg) 1705 1704 }; 1706 1705 struct ceph_frame_desc desc; 1707 1706 int ret; 1708 1707 1709 1708 dout("%s con %p msg %p logical %d+%d+%d+%d\n", __func__, con, 1710 - con->out_msg, lens[0], lens[1], lens[2], lens[3]); 1709 + msg, lens[0], lens[1], lens[2], lens[3]); 1711 1710 1712 1711 if (con->in_seq > con->in_seq_acked) { 1713 1712 dout("%s con %p in_seq_acked %llu -> %llu\n", __func__, con, ··· 1718 1717 reset_out_kvecs(con); 1719 1718 init_frame_desc(&desc, FRAME_TAG_MESSAGE, lens, 4); 1720 1719 encode_preamble(&desc, con->v2.out_buf); 1721 - fill_header2(CTRL_BODY(con->v2.out_buf), &con->out_msg->hdr, 1720 + fill_header2(CTRL_BODY(con->v2.out_buf), &msg->hdr, 1722 1721 con->in_seq_acked); 1723 1722 1724 1723 if (con_secure(con)) { 1725 - ret = prepare_message_secure(con); 1724 + ret = prepare_message_secure(con, msg); 1726 1725 if (ret) 1727 1726 return ret; 1728 1727 } else { 1729 - prepare_message_plain(con); 1728 + prepare_message_plain(con, msg); 1730 1729 } 1731 1730 1732 1731 ceph_con_flag_set(con, CEPH_CON_F_WRITE_PENDING); ··· 3154 3153 } 3155 3154 } 3156 3155 3157 - static void queue_data(struct ceph_connection *con) 3156 + static void queue_data(struct ceph_connection *con, struct ceph_msg *msg) 3158 3157 { 3159 3158 struct bio_vec bv; 3160 3159 3161 3160 con->v2.out_epil.data_crc = -1; 3162 - ceph_msg_data_cursor_init(&con->v2.out_cursor, con->out_msg, 3163 - data_len(con->out_msg)); 3161 + ceph_msg_data_cursor_init(&con->v2.out_cursor, msg, 3162 + data_len(msg)); 3164 3163 3165 3164 get_bvec_at(&con->v2.out_cursor, &bv); 3166 3165 set_out_bvec(con, &bv, true); 3167 3166 con->v2.out_state = OUT_S_QUEUE_DATA_CONT; 3168 3167 } 3169 3168 3170 - static void queue_data_cont(struct ceph_connection *con) 3169 + static void queue_data_cont(struct ceph_connection *con, struct ceph_msg *msg) 3171 3170 { 3172 3171 struct bio_vec bv; 3173 3172 ··· 3188 3187 * we are done. 3189 3188 */ 3190 3189 reset_out_kvecs(con); 3191 - prepare_epilogue_plain(con, false); 3190 + prepare_epilogue_plain(con, msg, false); 3192 3191 con->v2.out_state = OUT_S_FINISH_MESSAGE; 3193 3192 } 3194 3193 ··· 3220 3219 con->v2.out_state = OUT_S_FINISH_MESSAGE; 3221 3220 } 3222 3221 3223 - static void queue_zeros(struct ceph_connection *con) 3222 + static void queue_zeros(struct ceph_connection *con, struct ceph_msg *msg) 3224 3223 { 3225 3224 dout("%s con %p out_zero %d\n", __func__, con, con->v2.out_zero); 3226 3225 ··· 3237 3236 * Once it's written, we are done patching up for the revoke. 3238 3237 */ 3239 3238 reset_out_kvecs(con); 3240 - prepare_epilogue_plain(con, true); 3239 + prepare_epilogue_plain(con, msg, true); 3241 3240 con->v2.out_state = OUT_S_FINISH_MESSAGE; 3242 3241 } 3243 3242 ··· 3264 3263 3265 3264 static int populate_out_iter(struct ceph_connection *con) 3266 3265 { 3266 + struct ceph_msg *msg; 3267 3267 int ret; 3268 3268 3269 3269 dout("%s con %p state %d out_state %d\n", __func__, con, con->state, ··· 3280 3278 switch (con->v2.out_state) { 3281 3279 case OUT_S_QUEUE_DATA: 3282 3280 WARN_ON(!con->out_msg); 3283 - queue_data(con); 3281 + queue_data(con, con->out_msg); 3284 3282 goto populated; 3285 3283 case OUT_S_QUEUE_DATA_CONT: 3286 3284 WARN_ON(!con->out_msg); 3287 - queue_data_cont(con); 3285 + queue_data_cont(con, con->out_msg); 3288 3286 goto populated; 3289 3287 case OUT_S_QUEUE_ENC_PAGE: 3290 3288 queue_enc_page(con); 3291 3289 goto populated; 3292 3290 case OUT_S_QUEUE_ZEROS: 3293 3291 WARN_ON(con->out_msg); /* revoked */ 3294 - queue_zeros(con); 3292 + queue_zeros(con, con->out_msg); 3295 3293 goto populated; 3296 3294 case OUT_S_FINISH_MESSAGE: 3297 3295 finish_message(con); ··· 3311 3309 return ret; 3312 3310 } 3313 3311 } else if (!list_empty(&con->out_queue)) { 3314 - ceph_con_get_out_msg(con); 3315 - ret = prepare_message(con); 3312 + msg = ceph_con_get_out_msg(con); 3313 + ret = prepare_message(con, msg); 3316 3314 if (ret) { 3317 3315 pr_err("prepare_message failed: %d\n", ret); 3318 3316 return ret; ··· 3424 3422 return crc; 3425 3423 } 3426 3424 3427 - static void prepare_zero_front(struct ceph_connection *con, int resid) 3425 + static void prepare_zero_front(struct ceph_connection *con, 3426 + struct ceph_msg *msg, int resid) 3428 3427 { 3429 3428 int sent; 3430 3429 3431 - WARN_ON(!resid || resid > front_len(con->out_msg)); 3432 - sent = front_len(con->out_msg) - resid; 3430 + WARN_ON(!resid || resid > front_len(msg)); 3431 + sent = front_len(msg) - resid; 3433 3432 dout("%s con %p sent %d resid %d\n", __func__, con, sent, resid); 3434 3433 3435 3434 if (sent) { 3436 3435 con->v2.out_epil.front_crc = 3437 - crc32c(-1, con->out_msg->front.iov_base, sent); 3436 + crc32c(-1, msg->front.iov_base, sent); 3438 3437 con->v2.out_epil.front_crc = 3439 3438 crc32c_zeros(con->v2.out_epil.front_crc, resid); 3440 3439 } else { ··· 3446 3443 out_zero_add(con, resid); 3447 3444 } 3448 3445 3449 - static void prepare_zero_middle(struct ceph_connection *con, int resid) 3446 + static void prepare_zero_middle(struct ceph_connection *con, 3447 + struct ceph_msg *msg, int resid) 3450 3448 { 3451 3449 int sent; 3452 3450 3453 - WARN_ON(!resid || resid > middle_len(con->out_msg)); 3454 - sent = middle_len(con->out_msg) - resid; 3451 + WARN_ON(!resid || resid > middle_len(msg)); 3452 + sent = middle_len(msg) - resid; 3455 3453 dout("%s con %p sent %d resid %d\n", __func__, con, sent, resid); 3456 3454 3457 3455 if (sent) { 3458 3456 con->v2.out_epil.middle_crc = 3459 - crc32c(-1, con->out_msg->middle->vec.iov_base, sent); 3457 + crc32c(-1, msg->middle->vec.iov_base, sent); 3460 3458 con->v2.out_epil.middle_crc = 3461 3459 crc32c_zeros(con->v2.out_epil.middle_crc, resid); 3462 3460 } else { ··· 3468 3464 out_zero_add(con, resid); 3469 3465 } 3470 3466 3471 - static void prepare_zero_data(struct ceph_connection *con) 3467 + static void prepare_zero_data(struct ceph_connection *con, 3468 + struct ceph_msg *msg) 3472 3469 { 3473 3470 dout("%s con %p\n", __func__, con); 3474 - con->v2.out_epil.data_crc = crc32c_zeros(-1, data_len(con->out_msg)); 3475 - out_zero_add(con, data_len(con->out_msg)); 3471 + con->v2.out_epil.data_crc = crc32c_zeros(-1, data_len(msg)); 3472 + out_zero_add(con, data_len(msg)); 3476 3473 } 3477 3474 3478 - static void revoke_at_queue_data(struct ceph_connection *con) 3475 + static void revoke_at_queue_data(struct ceph_connection *con, 3476 + struct ceph_msg *msg) 3479 3477 { 3480 3478 int boundary; 3481 3479 int resid; 3482 3480 3483 - WARN_ON(!data_len(con->out_msg)); 3481 + WARN_ON(!data_len(msg)); 3484 3482 WARN_ON(!iov_iter_is_kvec(&con->v2.out_iter)); 3485 3483 resid = iov_iter_count(&con->v2.out_iter); 3486 3484 3487 - boundary = front_len(con->out_msg) + middle_len(con->out_msg); 3485 + boundary = front_len(msg) + middle_len(msg); 3488 3486 if (resid > boundary) { 3489 3487 resid -= boundary; 3490 3488 WARN_ON(resid > MESSAGE_HEAD_PLAIN_LEN); 3491 3489 dout("%s con %p was sending head\n", __func__, con); 3492 - if (front_len(con->out_msg)) 3493 - prepare_zero_front(con, front_len(con->out_msg)); 3494 - if (middle_len(con->out_msg)) 3495 - prepare_zero_middle(con, middle_len(con->out_msg)); 3496 - prepare_zero_data(con); 3490 + if (front_len(msg)) 3491 + prepare_zero_front(con, msg, front_len(msg)); 3492 + if (middle_len(msg)) 3493 + prepare_zero_middle(con, msg, middle_len(msg)); 3494 + prepare_zero_data(con, msg); 3497 3495 WARN_ON(iov_iter_count(&con->v2.out_iter) != resid); 3498 3496 con->v2.out_state = OUT_S_QUEUE_ZEROS; 3499 3497 return; 3500 3498 } 3501 3499 3502 - boundary = middle_len(con->out_msg); 3500 + boundary = middle_len(msg); 3503 3501 if (resid > boundary) { 3504 3502 resid -= boundary; 3505 3503 dout("%s con %p was sending front\n", __func__, con); 3506 - prepare_zero_front(con, resid); 3507 - if (middle_len(con->out_msg)) 3508 - prepare_zero_middle(con, middle_len(con->out_msg)); 3509 - prepare_zero_data(con); 3510 - queue_zeros(con); 3504 + prepare_zero_front(con, msg, resid); 3505 + if (middle_len(msg)) 3506 + prepare_zero_middle(con, msg, middle_len(msg)); 3507 + prepare_zero_data(con, msg); 3508 + queue_zeros(con, msg); 3511 3509 return; 3512 3510 } 3513 3511 3514 3512 WARN_ON(!resid); 3515 3513 dout("%s con %p was sending middle\n", __func__, con); 3516 - prepare_zero_middle(con, resid); 3517 - prepare_zero_data(con); 3518 - queue_zeros(con); 3514 + prepare_zero_middle(con, msg, resid); 3515 + prepare_zero_data(con, msg); 3516 + queue_zeros(con, msg); 3519 3517 } 3520 3518 3521 - static void revoke_at_queue_data_cont(struct ceph_connection *con) 3519 + static void revoke_at_queue_data_cont(struct ceph_connection *con, 3520 + struct ceph_msg *msg) 3522 3521 { 3523 3522 int sent, resid; /* current piece of data */ 3524 3523 3525 - WARN_ON(!data_len(con->out_msg)); 3524 + WARN_ON(!data_len(msg)); 3526 3525 WARN_ON(!iov_iter_is_bvec(&con->v2.out_iter)); 3527 3526 resid = iov_iter_count(&con->v2.out_iter); 3528 3527 WARN_ON(!resid || resid > con->v2.out_bvec.bv_len); ··· 3544 3537 3545 3538 con->v2.out_iter.count -= resid; 3546 3539 out_zero_add(con, con->v2.out_cursor.total_resid); 3547 - queue_zeros(con); 3540 + queue_zeros(con, msg); 3548 3541 } 3549 3542 3550 - static void revoke_at_finish_message(struct ceph_connection *con) 3543 + static void revoke_at_finish_message(struct ceph_connection *con, 3544 + struct ceph_msg *msg) 3551 3545 { 3552 3546 int boundary; 3553 3547 int resid; ··· 3556 3548 WARN_ON(!iov_iter_is_kvec(&con->v2.out_iter)); 3557 3549 resid = iov_iter_count(&con->v2.out_iter); 3558 3550 3559 - if (!front_len(con->out_msg) && !middle_len(con->out_msg) && 3560 - !data_len(con->out_msg)) { 3551 + if (!front_len(msg) && !middle_len(msg) && 3552 + !data_len(msg)) { 3561 3553 WARN_ON(!resid || resid > MESSAGE_HEAD_PLAIN_LEN); 3562 3554 dout("%s con %p was sending head (empty message) - noop\n", 3563 3555 __func__, con); 3564 3556 return; 3565 3557 } 3566 3558 3567 - boundary = front_len(con->out_msg) + middle_len(con->out_msg) + 3559 + boundary = front_len(msg) + middle_len(msg) + 3568 3560 CEPH_EPILOGUE_PLAIN_LEN; 3569 3561 if (resid > boundary) { 3570 3562 resid -= boundary; 3571 3563 WARN_ON(resid > MESSAGE_HEAD_PLAIN_LEN); 3572 3564 dout("%s con %p was sending head\n", __func__, con); 3573 - if (front_len(con->out_msg)) 3574 - prepare_zero_front(con, front_len(con->out_msg)); 3575 - if (middle_len(con->out_msg)) 3576 - prepare_zero_middle(con, middle_len(con->out_msg)); 3565 + if (front_len(msg)) 3566 + prepare_zero_front(con, msg, front_len(msg)); 3567 + if (middle_len(msg)) 3568 + prepare_zero_middle(con, msg, middle_len(msg)); 3577 3569 con->v2.out_iter.count -= CEPH_EPILOGUE_PLAIN_LEN; 3578 3570 WARN_ON(iov_iter_count(&con->v2.out_iter) != resid); 3579 3571 con->v2.out_state = OUT_S_QUEUE_ZEROS; 3580 3572 return; 3581 3573 } 3582 3574 3583 - boundary = middle_len(con->out_msg) + CEPH_EPILOGUE_PLAIN_LEN; 3575 + boundary = middle_len(msg) + CEPH_EPILOGUE_PLAIN_LEN; 3584 3576 if (resid > boundary) { 3585 3577 resid -= boundary; 3586 3578 dout("%s con %p was sending front\n", __func__, con); 3587 - prepare_zero_front(con, resid); 3588 - if (middle_len(con->out_msg)) 3589 - prepare_zero_middle(con, middle_len(con->out_msg)); 3579 + prepare_zero_front(con, msg, resid); 3580 + if (middle_len(msg)) 3581 + prepare_zero_middle(con, msg, middle_len(msg)); 3590 3582 con->v2.out_iter.count -= CEPH_EPILOGUE_PLAIN_LEN; 3591 - queue_zeros(con); 3583 + queue_zeros(con, msg); 3592 3584 return; 3593 3585 } 3594 3586 ··· 3596 3588 if (resid > boundary) { 3597 3589 resid -= boundary; 3598 3590 dout("%s con %p was sending middle\n", __func__, con); 3599 - prepare_zero_middle(con, resid); 3591 + prepare_zero_middle(con, msg, resid); 3600 3592 con->v2.out_iter.count -= CEPH_EPILOGUE_PLAIN_LEN; 3601 - queue_zeros(con); 3593 + queue_zeros(con, msg); 3602 3594 return; 3603 3595 } 3604 3596 ··· 3606 3598 dout("%s con %p was sending epilogue - noop\n", __func__, con); 3607 3599 } 3608 3600 3609 - void ceph_con_v2_revoke(struct ceph_connection *con) 3601 + void ceph_con_v2_revoke(struct ceph_connection *con, struct ceph_msg *msg) 3610 3602 { 3611 3603 WARN_ON(con->v2.out_zero); 3612 3604 ··· 3619 3611 3620 3612 switch (con->v2.out_state) { 3621 3613 case OUT_S_QUEUE_DATA: 3622 - revoke_at_queue_data(con); 3614 + revoke_at_queue_data(con, msg); 3623 3615 break; 3624 3616 case OUT_S_QUEUE_DATA_CONT: 3625 - revoke_at_queue_data_cont(con); 3617 + revoke_at_queue_data_cont(con, msg); 3626 3618 break; 3627 3619 case OUT_S_FINISH_MESSAGE: 3628 - revoke_at_finish_message(con); 3620 + revoke_at_finish_message(con, msg); 3629 3621 break; 3630 3622 default: 3631 3623 WARN(1, "bad out_state %d", con->v2.out_state);