lkml.org 
[lkml]   [2023]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] block: Rework bio_for_each_folio_all()
On Mon, Apr 03, 2023 at 08:13:21AM -0700, Christoph Hellwig wrote:
> On Mon, Mar 27, 2023 at 01:44:02PM -0400, Kent Overstreet wrote:
> > + bio_for_each_folio_all(fv, bio, iter)
> > + iomap_finish_folio_read(fv.fv_folio, fv.fv_offset, fv.fv_len, error);
>
> Please avoid the overly long lines. Also if we pass all arguments
> of the folio_vec we might as ell just pass that folio_vec anyway.
>
> > - BUG_ON(iter->idx > bio->bi_vcnt || (iter->idx == bio->bi_vcnt && iter->done));
> > + BUG_ON(iter->idx > bio->bi_vcnt ||
> > + (iter->idx == bio->bi_vcnt && iter->done));
>
> Seems like this should be folded into the previous patch. Also I
> generally prefer to avoid top-level || in asserts and just do multiple
> asserts, as that shows which condition triggered.

It should be folded in, but it's logically the same assert (advance
past the end of the iter) so not worth the increased code size.

\
 
 \ /
  Last update: 2023-04-03 17:53    [W:0.135 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site