aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r--net/ceph/messenger.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 6b5b5c625547..2fabf006e8f5 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1460,8 +1460,8 @@ static u32 ceph_crc32c_page(u32 crc, struct page *page,
1460static int write_partial_message_data(struct ceph_connection *con) 1460static int write_partial_message_data(struct ceph_connection *con)
1461{ 1461{
1462 struct ceph_msg *msg = con->out_msg; 1462 struct ceph_msg *msg = con->out_msg;
1463 struct ceph_msg_data_cursor *cursor = &msg->data.cursor;
1463 struct ceph_msg_pos *msg_pos = &con->out_msg_pos; 1464 struct ceph_msg_pos *msg_pos = &con->out_msg_pos;
1464 unsigned int data_len = le32_to_cpu(msg->hdr.data_len);
1465 bool do_datacrc = !con->msgr->nocrc; 1465 bool do_datacrc = !con->msgr->nocrc;
1466 int ret; 1466 int ret;
1467 1467
@@ -1479,7 +1479,7 @@ static int write_partial_message_data(struct ceph_connection *con)
1479 * need to map the page. If we have no pages, they have 1479 * need to map the page. If we have no pages, they have
1480 * been revoked, so use the zero page. 1480 * been revoked, so use the zero page.
1481 */ 1481 */
1482 while (data_len > msg_pos->data_pos) { 1482 while (cursor->resid) {
1483 struct page *page; 1483 struct page *page;
1484 size_t page_offset; 1484 size_t page_offset;
1485 size_t length; 1485 size_t length;
@@ -1489,7 +1489,6 @@ static int write_partial_message_data(struct ceph_connection *con)
1489 &last_piece); 1489 &last_piece);
1490 if (do_datacrc && !msg_pos->did_page_crc) { 1490 if (do_datacrc && !msg_pos->did_page_crc) {
1491 u32 crc = le32_to_cpu(msg->footer.data_crc); 1491 u32 crc = le32_to_cpu(msg->footer.data_crc);
1492
1493 crc = ceph_crc32c_page(crc, page, page_offset, length); 1492 crc = ceph_crc32c_page(crc, page, page_offset, length);
1494 msg->footer.data_crc = cpu_to_le32(crc); 1493 msg->footer.data_crc = cpu_to_le32(crc);
1495 msg_pos->did_page_crc = true; 1494 msg_pos->did_page_crc = true;
@@ -2158,7 +2157,7 @@ static int read_partial_message_section(struct ceph_connection *con,
2158static int read_partial_msg_data(struct ceph_connection *con) 2157static int read_partial_msg_data(struct ceph_connection *con)
2159{ 2158{
2160 struct ceph_msg *msg = con->in_msg; 2159 struct ceph_msg *msg = con->in_msg;
2161 struct ceph_msg_pos *msg_pos = &con->in_msg_pos; 2160 struct ceph_msg_data_cursor *cursor = &msg->data.cursor;
2162 const bool do_datacrc = !con->msgr->nocrc; 2161 const bool do_datacrc = !con->msgr->nocrc;
2163 unsigned int data_len; 2162 unsigned int data_len;
2164 struct page *page; 2163 struct page *page;
@@ -2171,7 +2170,7 @@ static int read_partial_msg_data(struct ceph_connection *con)
2171 return -EIO; 2170 return -EIO;
2172 2171
2173 data_len = le32_to_cpu(con->in_hdr.data_len); 2172 data_len = le32_to_cpu(con->in_hdr.data_len);
2174 while (msg_pos->data_pos < data_len) { 2173 while (cursor->resid) {
2175 page = ceph_msg_data_next(&msg->data, &page_offset, &length, 2174 page = ceph_msg_data_next(&msg->data, &page_offset, &length,
2176 NULL); 2175 NULL);
2177 ret = ceph_tcp_recvpage(con->sock, page, page_offset, length); 2176 ret = ceph_tcp_recvpage(con->sock, page, page_offset, length);