[11/16] libceph: remove not necessary checks on doing advance on bio and bvecs cursor
diff mbox series

Message ID 20200421131850.443228-12-rpenyaev@suse.de
State New
Headers show
Series
  • libceph: messenger: send/recv data at one go
Related show

Commit Message

Roman Penyaev April 21, 2020, 1:18 p.m. UTC
They were used for returning false, indicating that we are still
on the same page.  Caller is not interested now, so just remove.

Signed-off-by: Roman Penyaev <rpenyaev@suse.de>
---
 net/ceph/messenger.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

Patch
diff mbox series

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 3f8a47de62c7..7465039da9f5 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -861,20 +861,14 @@  static void ceph_msg_data_bio_advance(struct ceph_msg_data_cursor *cursor,
 				      size_t bytes)
 {
 	struct ceph_bio_iter *it = &cursor->bio_iter;
-	struct page *page = bio_iter_page(it->bio, it->iter);
 
 	BUG_ON(bytes > cursor->resid);
 	BUG_ON(bytes > bio_iter_len(it->bio, it->iter));
 	cursor->resid -= bytes;
 	bio_advance_iter(it->bio, &it->iter, bytes);
 
-	if (!cursor->resid) {
+	if (!bytes || !cursor->resid)
 		return;   /* no more data */
-	}
-
-	if (!bytes || (it->iter.bi_size && it->iter.bi_bvec_done &&
-		       page == bio_iter_page(it->bio, it->iter)))
-		return;	/* more bytes to process in this segment */
 
 	if (!it->iter.bi_size) {
 		it->bio = it->bio->bi_next;
@@ -913,21 +907,12 @@  static void ceph_msg_data_bvecs_advance(struct ceph_msg_data_cursor *cursor,
 					size_t bytes)
 {
 	struct bio_vec *bvecs = cursor->data->bvec_pos.bvecs;
-	struct page *page = bvec_iter_page(bvecs, cursor->bvec_iter);
 
 	BUG_ON(bytes > cursor->resid);
 	BUG_ON(bytes > bvec_iter_len(bvecs, cursor->bvec_iter));
 	cursor->resid -= bytes;
 	bvec_iter_advance(bvecs, &cursor->bvec_iter, bytes);
 
-	if (!cursor->resid) {
-		return;   /* no more data */
-	}
-
-	if (!bytes || (cursor->bvec_iter.bi_bvec_done &&
-		       page == bvec_iter_page(bvecs, cursor->bvec_iter)))
-		return;	/* more bytes to process in this segment */
-
 	BUG_ON(cursor->resid < bvec_iter_len(bvecs, cursor->bvec_iter));
 }