mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
block: add bio_for_each_bvec_all()
An upcoming Btrfs fix needs to know the original size of a non-cloned bios. Rather than accessing the bvec table directly, let's add a bio_for_each_bvec_all() accessor. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
534cf531cc
commit
1072c12d7d
3 changed files with 11 additions and 0 deletions
|
@ -169,6 +169,14 @@ static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter,
|
|||
#define bio_for_each_bvec(bvl, bio, iter) \
|
||||
__bio_for_each_bvec(bvl, bio, iter, (bio)->bi_iter)
|
||||
|
||||
/*
|
||||
* Iterate over all multi-page bvecs. Drivers shouldn't use this version for the
|
||||
* same reasons as bio_for_each_segment_all().
|
||||
*/
|
||||
#define bio_for_each_bvec_all(bvl, bio, i) \
|
||||
for (i = 0, bvl = bio_first_bvec_all(bio); \
|
||||
i < (bio)->bi_vcnt; i++, bvl++) \
|
||||
|
||||
#define bio_iter_last(bvec, iter) ((iter).bi_size == (bvec).bv_len)
|
||||
|
||||
static inline unsigned bio_segments(struct bio *bio)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue