Re: [Cluster-devel] [PATCH V11 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec
On Thu, Nov 22, 2018 at 12:03:15PM +0100, Christoph Hellwig wrote: > > +/* used for chunk_for_each_segment */ > > +static inline void bvec_next_segment(const struct bio_vec *bvec, > > +struct bvec_iter_all *iter_all) > > FYI, chunk_for_each_segment doesn't exist anymore, this is > bvec_for_each_segment now. Not sure the comment helps much, though. OK, will remove the comment. > > > +{ > > + struct bio_vec *bv = _all->bv; > > + > > + if (bv->bv_page) { > > + bv->bv_page += 1; > > I think this needs to use nth_page() given that with discontigmem > page structures might not be allocated contigously. Good catch! Thanks, Ming
Re: [Cluster-devel] [PATCH V11 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec
> +/* used for chunk_for_each_segment */ > +static inline void bvec_next_segment(const struct bio_vec *bvec, > + struct bvec_iter_all *iter_all) FYI, chunk_for_each_segment doesn't exist anymore, this is bvec_for_each_segment now. Not sure the comment helps much, though. > +{ > + struct bio_vec *bv = _all->bv; > + > + if (bv->bv_page) { > + bv->bv_page += 1; I think this needs to use nth_page() given that with discontigmem page structures might not be allocated contigously.
Re: [Cluster-devel] [PATCH V11 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec
On Wed, Nov 21, 2018 at 11:23:20AM +0800, Ming Lei wrote: > This patch introduces one extra iterator variable to > bio_for_each_segment_all(), > then we can allow bio_for_each_segment_all() to iterate over multi-page bvec. > > Given it is just one mechannical & simple change on all > bio_for_each_segment_all() > users, this patch does tree-wide change in one single patch, so that we can > avoid to use a temporary helper for this conversion. > > Signed-off-by: Ming Lei Looks good, Reviewed-by: Christoph Hellwig