Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1706161 > unrolled thread

[PATCH v3 17/49] block: comments on bio_for_each_segment[_all]

Started byMing Lei <ming.lei@redhat.com>
First post2017-08-08 10:50 +0200
Last post2017-08-10 13:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3 17/49] block: comments on bio_for_each_segment[_all] Ming Lei <ming.lei@redhat.com> - 2017-08-08 10:50 +0200
    Re: [PATCH v3 17/49] block: comments on bio_for_each_segment[_all] Christoph Hellwig <hch@infradead.org> - 2017-08-10 13:40 +0200

#1706161 — [PATCH v3 17/49] block: comments on bio_for_each_segment[_all]

FromMing Lei <ming.lei@redhat.com>
Date2017-08-08 10:50 +0200
Subject[PATCH v3 17/49] block: comments on bio_for_each_segment[_all]
Message-ID<uc8n7-5sU-1@gated-at.bofh.it>
This patch clarifies the fact that even though both
bio_for_each_segment() and bio_for_each_segment_all()
are named as _segment/_segment_all, they still return
one page in each vector, instead of real segment(multipage bvec).

With comming multipage bvec, both the two helpers
are capable of returning real segment(multipage bvec),
but the callers(users) of the two helpers may not be
capable of handling of the multipage bvec or real
segment, so we still keep the interfaces of the helpers
not changed. And new helpers for returning multipage bvec(real segment)
will be introduced later.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 include/linux/bio.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/linux/bio.h b/include/linux/bio.h
index 7b1cf4ba0902..80defb3cfca4 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -155,7 +155,10 @@ static inline void *bio_data(struct bio *bio)
 
 /*
  * drivers should _never_ use the all version - the bio may have been split
- * before it got to the driver and the driver won't own all of it
+ * before it got to the driver and the driver won't own all of it.
+ *
+ * Even though the helper is named as _segment_all, it still returns
+ * page one by one instead of real segment.
  */
 #define bio_for_each_segment_all(bvl, bio, i)				\
 	for (i = 0, bvl = (bio)->bi_io_vec; i < (bio)->bi_vcnt; i++, bvl++)
@@ -194,6 +197,10 @@ static inline bool bio_rewind_iter(struct bio *bio, struct bvec_iter *iter,
 		((bvl = bio_iter_iovec((bio), (iter))), 1);		\
 	     bio_advance_iter((bio), &(iter), (bvl).bv_len))
 
+/*
+ * Even though the helper is named as _segment, it still returns
+ * page one by one instead of real segment.
+ */
 #define bio_for_each_segment(bvl, bio, iter)				\
 	__bio_for_each_segment(bvl, bio, iter, (bio)->bi_iter)
 
-- 
2.9.4

[toc] | [next] | [standalone]


#1708465

FromChristoph Hellwig <hch@infradead.org>
Date2017-08-10 13:40 +0200
Message-ID<ucTYJ-4Yg-1@gated-at.bofh.it>
In reply to#1706161
The comments should be added in the patches where semantics change,
not separately.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web