[PATCHv3 1/5] bvec: introduce multi-page bvec iterating
Christoph Hellwig
hch at lst.de
Mon Nov 20 21:01:12 PST 2023
On Mon, Nov 20, 2023 at 02:40:54PM -0800, Keith Busch wrote:
> diff --git a/include/linux/bvec.h b/include/linux/bvec.h
> index 555aae5448ae4..9364c258513e0 100644
> --- a/include/linux/bvec.h
> +++ b/include/linux/bvec.h
> @@ -184,6 +184,12 @@ static inline void bvec_iter_advance_single(const struct bio_vec *bv,
> ((bvl = bvec_iter_bvec((bio_vec), (iter))), 1); \
> bvec_iter_advance_single((bio_vec), &(iter), (bvl).bv_len))
>
> +#define for_each_mp_bvec(bvl, bio_vec, iter, start) \
> + for (iter = (start); \
> + (iter).bi_size && \
> + ((bvl = mp_bvec_iter_bvec((bio_vec), (iter))), 1); \
> + bvec_iter_advance_single((bio_vec), &(iter), (bvl).bv_len))
Hope thjis isn't too much bike-shedding, but in the block layer
we generally used _segment for the single page bvecs and just bvec
for the not page size limited. This isn't the best naming either,
but i wonder if it's worth to change the existing 4 callers and be
consistent. (and maybe one or two of them doesn't want the limit anyway?)
Otherwise this looks good to me.
More information about the Linux-nvme
mailing list