diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-08-07 17:24:32 -0400 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-24 01:33:49 -0500 |
commit | a4ad39b1d10584dfcfcfb0d510faab2c7f034399 (patch) | |
tree | a0747f9978fceb202975f43f15ed4489c6600894 /include | |
parent | 75d5d8156500cd3833d66806889372e294af514d (diff) |
block: Convert bio_iovec() to bvec_iter
For immutable biovecs, we'll be introducing a new bio_iovec() that uses
our new bvec iterator to construct a biovec, taking into account
bvec_iter->bi_bvec_done - this patch updates existing users for the new
usage.
Some of the existing users really do need a pointer into the bvec array
- those uses are all going to be removed, but we'll need the
functionality from immutable to remove them - so for now rename the
existing bio_iovec() -> __bio_iovec(), and it'll be removed in a couple
patches.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Ed L. Cashin" <ecashin@coraid.com>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: dm-devel@redhat.com
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/bio.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index e2e0bc642ed1..9f182fcbe714 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -62,9 +62,11 @@ | |||
62 | * on highmem page vectors | 62 | * on highmem page vectors |
63 | */ | 63 | */ |
64 | #define bio_iovec_idx(bio, idx) (&((bio)->bi_io_vec[(idx)])) | 64 | #define bio_iovec_idx(bio, idx) (&((bio)->bi_io_vec[(idx)])) |
65 | #define bio_iovec(bio) bio_iovec_idx((bio), (bio)->bi_iter.bi_idx) | 65 | #define __bio_iovec(bio) bio_iovec_idx((bio), (bio)->bi_iter.bi_idx) |
66 | #define bio_page(bio) bio_iovec((bio))->bv_page | 66 | #define bio_iovec(bio) (*__bio_iovec(bio)) |
67 | #define bio_offset(bio) bio_iovec((bio))->bv_offset | 67 | |
68 | #define bio_page(bio) (bio_iovec((bio)).bv_page) | ||
69 | #define bio_offset(bio) (bio_iovec((bio)).bv_offset) | ||
68 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_iter.bi_idx) | 70 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_iter.bi_idx) |
69 | #define bio_sectors(bio) ((bio)->bi_iter.bi_size >> 9) | 71 | #define bio_sectors(bio) ((bio)->bi_iter.bi_size >> 9) |
70 | #define bio_end_sector(bio) ((bio)->bi_iter.bi_sector + bio_sectors((bio))) | 72 | #define bio_end_sector(bio) ((bio)->bi_iter.bi_sector + bio_sectors((bio))) |
@@ -72,7 +74,7 @@ | |||
72 | static inline unsigned int bio_cur_bytes(struct bio *bio) | 74 | static inline unsigned int bio_cur_bytes(struct bio *bio) |
73 | { | 75 | { |
74 | if (bio->bi_vcnt) | 76 | if (bio->bi_vcnt) |
75 | return bio_iovec(bio)->bv_len; | 77 | return bio_iovec(bio).bv_len; |
76 | else /* dataless requests such as discard */ | 78 | else /* dataless requests such as discard */ |
77 | return bio->bi_iter.bi_size; | 79 | return bio->bi_iter.bi_size; |
78 | } | 80 | } |