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.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 0ac4f6cb7339..c795d46d7d4b 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1468,6 +1468,10 @@ static void in_msg_pos_next(struct ceph_connection *con, size_t len,
1468 1468
1469 msg_pos->data_pos += received; 1469 msg_pos->data_pos += received;
1470 msg_pos->page_pos += received; 1470 msg_pos->page_pos += received;
1471#ifdef CONFIG_BLOCK
1472 if (ceph_msg_has_bio(msg))
1473 (void) ceph_msg_data_advance(&msg->b, received);
1474#endif /* CONFIG_BLOCK */
1471 if (received < len) 1475 if (received < len)
1472 return; 1476 return;
1473 1477
@@ -2255,23 +2259,14 @@ static int read_partial_message_bio(struct ceph_connection *con,
2255 unsigned int data_len, bool do_datacrc) 2259 unsigned int data_len, bool do_datacrc)
2256{ 2260{
2257 struct ceph_msg *msg = con->in_msg; 2261 struct ceph_msg *msg = con->in_msg;
2258 struct ceph_msg_pos *msg_pos = &con->in_msg_pos;
2259 struct bio_vec *bv;
2260 struct page *page; 2262 struct page *page;
2261 size_t page_offset; 2263 size_t page_offset;
2262 size_t length; 2264 size_t length;
2263 unsigned int left;
2264 int ret; 2265 int ret;
2265 2266
2266 BUG_ON(!msg); 2267 BUG_ON(!msg);
2267 BUG_ON(!msg->b.bio_iter); 2268
2268 bv = bio_iovec_idx(msg->b.bio_iter, msg->b.bio_seg); 2269 page = ceph_msg_data_next(&msg->b, &page_offset, &length, NULL);
2269 page = bv->bv_page;
2270 page_offset = bv->bv_offset + msg_pos->page_pos;
2271 BUG_ON(msg_pos->data_pos >= data_len);
2272 left = data_len - msg_pos->data_pos;
2273 BUG_ON(msg_pos->page_pos >= bv->bv_len);
2274 length = min_t(unsigned int, bv->bv_len - msg_pos->page_pos, left);
2275 2270
2276 ret = ceph_tcp_recvpage(con->sock, page, page_offset, length); 2271 ret = ceph_tcp_recvpage(con->sock, page, page_offset, length);
2277 if (ret <= 0) 2272 if (ret <= 0)