diff mbox

[v3,09/49] block: comment on bio_iov_iter_get_pages()

Message ID 20170808084548.18963-10-ming.lei@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ming Lei Aug. 8, 2017, 8:45 a.m. UTC
bio_iov_iter_get_pages() used unused bvec spaces for
storing page pointer array temporarily, and this patch
comments on this usage wrt. multipage bvec support.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 block/bio.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Christoph Hellwig Aug. 10, 2017, 11:28 a.m. UTC | #1
> + * The hacking way of using bvec table as page pointer array is safe
> + * even after multipage bvec is introduced because that space can be
> + * thought as unused by bio_add_page().

I'm not sure what value this comment adds.

Note that once we have multi-page biovecs this could should change
to take advantage of multipage biovecs, so adding a comment before
that doesn't seem too helpful.
Ming Lei Oct. 19, 2017, 10:55 p.m. UTC | #2
On Thu, Aug 10, 2017 at 04:28:05AM -0700, Christoph Hellwig wrote:
> > + * The hacking way of using bvec table as page pointer array is safe
> > + * even after multipage bvec is introduced because that space can be
> > + * thought as unused by bio_add_page().
> 
> I'm not sure what value this comment adds.
> 
> Note that once we have multi-page biovecs this could should change
> to take advantage of multipage biovecs, so adding a comment before
> that doesn't seem too helpful.

As mentioned in comment on patch 8, bio_alloc_pages() should be move
to bcache.
diff mbox

Patch

diff --git a/block/bio.c b/block/bio.c
index 826b5d173416..28697e3c8ce3 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -875,6 +875,10 @@  EXPORT_SYMBOL(bio_add_page);
  *
  * Pins as many pages from *iter and appends them to @bio's bvec array. The
  * pages will have to be released using put_page() when done.
+ *
+ * The hacking way of using bvec table as page pointer array is safe
+ * even after multipage bvec is introduced because that space can be
+ * thought as unused by bio_add_page().
  */
 int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)
 {