On Thu, Aug 10, 2017 at 04:29:59AM -0700, Christoph Hellwig wrote:
> > +static unsigned int get_bio_pages(struct bio *bio)
> > +{
> > + unsigned i;
> > + struct bio_vec *bv;
> > +
> > + bio_for_each_segment_all(bv, bio, i)
> > + ;
> > +
> > + return i;
> > +}
>
>
> +static unsigned int get_bio_pages(struct bio *bio)
> +{
> + unsigned i;
> + struct bio_vec *bv;
> +
> + bio_for_each_segment_all(bv, bio, i)
> + ;
> +
> + return i;
> +}
s/get_bio_pages/bio_nr_pages/ ?
Also this seems like a useful helper for bio.h
--
To
BTRFS uses bio->bi_vcnt to figure out page numbers, this
way becomes not correct once we start to enable multipage
bvec.
So use bio_for_each_segment_all() to do that instead.
Cc: Chris Mason
Cc: Josef Bacik
Cc: David Sterba
Cc: