diff options
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 | } |