diff options
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r-- | include/linux/bio.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 7b214fd672a2..2a04eb54c0dd 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -218,12 +218,12 @@ struct bio { | |||
218 | #define bio_sectors(bio) ((bio)->bi_size >> 9) | 218 | #define bio_sectors(bio) ((bio)->bi_size >> 9) |
219 | #define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio)) | 219 | #define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio)) |
220 | 220 | ||
221 | static inline unsigned int bio_cur_sectors(struct bio *bio) | 221 | static inline unsigned int bio_cur_bytes(struct bio *bio) |
222 | { | 222 | { |
223 | if (bio->bi_vcnt) | 223 | if (bio->bi_vcnt) |
224 | return bio_iovec(bio)->bv_len >> 9; | 224 | return bio_iovec(bio)->bv_len; |
225 | else /* dataless requests such as discard */ | 225 | else /* dataless requests such as discard */ |
226 | return bio->bi_size >> 9; | 226 | return bio->bi_size; |
227 | } | 227 | } |
228 | 228 | ||
229 | static inline void *bio_data(struct bio *bio) | 229 | static inline void *bio_data(struct bio *bio) |
@@ -279,7 +279,7 @@ static inline int bio_has_allocated_vec(struct bio *bio) | |||
279 | #define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \ | 279 | #define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \ |
280 | (((addr1) | (mask)) == (((addr2) - 1) | (mask))) | 280 | (((addr1) | (mask)) == (((addr2) - 1) | (mask))) |
281 | #define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ | 281 | #define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ |
282 | __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, (q)->seg_boundary_mask) | 282 | __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, queue_segment_boundary((q))) |
283 | #define BIO_SEG_BOUNDARY(q, b1, b2) \ | 283 | #define BIO_SEG_BOUNDARY(q, b1, b2) \ |
284 | BIOVEC_SEG_BOUNDARY((q), __BVEC_END((b1)), __BVEC_START((b2))) | 284 | BIOVEC_SEG_BOUNDARY((q), __BVEC_END((b1)), __BVEC_START((b2))) |
285 | 285 | ||
@@ -506,7 +506,7 @@ static inline int bio_has_data(struct bio *bio) | |||
506 | } | 506 | } |
507 | 507 | ||
508 | /* | 508 | /* |
509 | * BIO list managment for use by remapping drivers (e.g. DM or MD). | 509 | * BIO list management for use by remapping drivers (e.g. DM or MD) and loop. |
510 | * | 510 | * |
511 | * A bio_list anchors a singly-linked list of bios chained through the bi_next | 511 | * A bio_list anchors a singly-linked list of bios chained through the bi_next |
512 | * member of the bio. The bio_list also caches the last list member to allow | 512 | * member of the bio. The bio_list also caches the last list member to allow |
@@ -590,6 +590,11 @@ static inline void bio_list_merge_head(struct bio_list *bl, | |||
590 | bl->head = bl2->head; | 590 | bl->head = bl2->head; |
591 | } | 591 | } |
592 | 592 | ||
593 | static inline struct bio *bio_list_peek(struct bio_list *bl) | ||
594 | { | ||
595 | return bl->head; | ||
596 | } | ||
597 | |||
593 | static inline struct bio *bio_list_pop(struct bio_list *bl) | 598 | static inline struct bio *bio_list_pop(struct bio_list *bl) |
594 | { | 599 | { |
595 | struct bio *bio = bl->head; | 600 | struct bio *bio = bl->head; |