aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r--include/linux/bio.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 5274103434ad..ce33e6868a2f 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -66,10 +66,6 @@
66#define bio_offset(bio) bio_iovec((bio))->bv_offset 66#define bio_offset(bio) bio_iovec((bio))->bv_offset
67#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) 67#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx)
68#define bio_sectors(bio) ((bio)->bi_size >> 9) 68#define bio_sectors(bio) ((bio)->bi_size >> 9)
69#define bio_empty_barrier(bio) \
70 ((bio->bi_rw & REQ_HARDBARRIER) && \
71 !bio_has_data(bio) && \
72 !(bio->bi_rw & REQ_DISCARD))
73 69
74static inline unsigned int bio_cur_bytes(struct bio *bio) 70static inline unsigned int bio_cur_bytes(struct bio *bio)
75{ 71{
@@ -308,7 +304,6 @@ struct biovec_slab {
308}; 304};
309 305
310extern struct bio_set *fs_bio_set; 306extern struct bio_set *fs_bio_set;
311extern struct biovec_slab bvec_slabs[BIOVEC_NR_POOLS] __read_mostly;
312 307
313/* 308/*
314 * a small number of entries is fine, not going to be performance critical. 309 * a small number of entries is fine, not going to be performance critical.
@@ -346,8 +341,15 @@ static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags)
346} 341}
347 342
348#else 343#else
349#define bvec_kmap_irq(bvec, flags) (page_address((bvec)->bv_page) + (bvec)->bv_offset) 344static inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags)
350#define bvec_kunmap_irq(buf, flags) do { *(flags) = 0; } while (0) 345{
346 return page_address(bvec->bv_page) + bvec->bv_offset;
347}
348
349static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags)
350{
351 *flags = 0;
352}
351#endif 353#endif
352 354
353static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx, 355static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,
@@ -496,6 +498,10 @@ static inline struct bio *bio_list_get(struct bio_list *bl)
496#define bip_for_each_vec(bvl, bip, i) \ 498#define bip_for_each_vec(bvl, bip, i) \
497 __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx) 499 __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx)
498 500
501#define bio_for_each_integrity_vec(_bvl, _bio, _iter) \
502 for_each_bio(_bio) \
503 bip_for_each_vec(_bvl, _bio->bi_integrity, _iter)
504
499#define bio_integrity(bio) (bio->bi_integrity != NULL) 505#define bio_integrity(bio) (bio->bi_integrity != NULL)
500 506
501extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *); 507extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *);