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.h37
1 files changed, 15 insertions, 22 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index d8bd43bfdcf5..b900d2c67d29 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -145,20 +145,21 @@ struct bio {
145 * bit 2 -- barrier 145 * bit 2 -- barrier
146 * Insert a serialization point in the IO queue, forcing previously 146 * Insert a serialization point in the IO queue, forcing previously
147 * submitted IO to be completed before this one is issued. 147 * submitted IO to be completed before this one is issued.
148 * bit 3 -- synchronous I/O hint: the block layer will unplug immediately 148 * bit 3 -- synchronous I/O hint.
149 * Note that this does NOT indicate that the IO itself is sync, just 149 * bit 4 -- Unplug the device immediately after submitting this bio.
150 * that the block layer will not postpone issue of this IO by plugging. 150 * bit 5 -- metadata request
151 * bit 4 -- metadata request
152 * Used for tracing to differentiate metadata and data IO. May also 151 * Used for tracing to differentiate metadata and data IO. May also
153 * get some preferential treatment in the IO scheduler 152 * get some preferential treatment in the IO scheduler
154 * bit 5 -- discard sectors 153 * bit 6 -- discard sectors
155 * Informs the lower level device that this range of sectors is no longer 154 * Informs the lower level device that this range of sectors is no longer
156 * used by the file system and may thus be freed by the device. Used 155 * used by the file system and may thus be freed by the device. Used
157 * for flash based storage. 156 * for flash based storage.
158 * bit 6 -- fail fast device errors 157 * bit 7 -- fail fast device errors
159 * bit 7 -- fail fast transport errors 158 * bit 8 -- fail fast transport errors
160 * bit 8 -- fail fast driver errors 159 * bit 9 -- fail fast driver errors
161 * Don't want driver retries for any fast fail whatever the reason. 160 * Don't want driver retries for any fast fail whatever the reason.
161 * bit 10 -- Tell the IO scheduler not to wait for more requests after this
162 one has been submitted, even if it is a SYNC request.
162 */ 163 */
163#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ 164#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */
164#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ 165#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */
@@ -170,6 +171,7 @@ struct bio {
170#define BIO_RW_FAILFAST_DEV 7 171#define BIO_RW_FAILFAST_DEV 7
171#define BIO_RW_FAILFAST_TRANSPORT 8 172#define BIO_RW_FAILFAST_TRANSPORT 8
172#define BIO_RW_FAILFAST_DRIVER 9 173#define BIO_RW_FAILFAST_DRIVER 9
174#define BIO_RW_NOIDLE 10
173 175
174#define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag))) 176#define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag)))
175 177
@@ -188,6 +190,7 @@ struct bio {
188#define bio_rw_ahead(bio) bio_rw_flagged(bio, BIO_RW_AHEAD) 190#define bio_rw_ahead(bio) bio_rw_flagged(bio, BIO_RW_AHEAD)
189#define bio_rw_meta(bio) bio_rw_flagged(bio, BIO_RW_META) 191#define bio_rw_meta(bio) bio_rw_flagged(bio, BIO_RW_META)
190#define bio_discard(bio) bio_rw_flagged(bio, BIO_RW_DISCARD) 192#define bio_discard(bio) bio_rw_flagged(bio, BIO_RW_DISCARD)
193#define bio_noidle(bio) bio_rw_flagged(bio, BIO_RW_NOIDLE)
191 194
192/* 195/*
193 * upper 16 bits of bi_rw define the io priority of this bio 196 * upper 16 bits of bi_rw define the io priority of this bio
@@ -426,9 +429,6 @@ struct bio_set {
426 unsigned int front_pad; 429 unsigned int front_pad;
427 430
428 mempool_t *bio_pool; 431 mempool_t *bio_pool;
429#if defined(CONFIG_BLK_DEV_INTEGRITY)
430 mempool_t *bio_integrity_pool;
431#endif
432 mempool_t *bvec_pool; 432 mempool_t *bvec_pool;
433}; 433};
434 434
@@ -519,9 +519,8 @@ static inline int bio_has_data(struct bio *bio)
519 519
520#define bio_integrity(bio) (bio->bi_integrity != NULL) 520#define bio_integrity(bio) (bio->bi_integrity != NULL)
521 521
522extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *);
523extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); 522extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int);
524extern void bio_integrity_free(struct bio *, struct bio_set *); 523extern void bio_integrity_free(struct bio *);
525extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int); 524extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int);
526extern int bio_integrity_enabled(struct bio *bio); 525extern int bio_integrity_enabled(struct bio *bio);
527extern int bio_integrity_set_tag(struct bio *, void *, unsigned int); 526extern int bio_integrity_set_tag(struct bio *, void *, unsigned int);
@@ -531,27 +530,21 @@ extern void bio_integrity_endio(struct bio *, int);
531extern void bio_integrity_advance(struct bio *, unsigned int); 530extern void bio_integrity_advance(struct bio *, unsigned int);
532extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); 531extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int);
533extern void bio_integrity_split(struct bio *, struct bio_pair *, int); 532extern void bio_integrity_split(struct bio *, struct bio_pair *, int);
534extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t, struct bio_set *); 533extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t);
535extern int bioset_integrity_create(struct bio_set *, int);
536extern void bioset_integrity_free(struct bio_set *);
537extern void bio_integrity_init_slab(void);
538 534
539#else /* CONFIG_BLK_DEV_INTEGRITY */ 535#else /* CONFIG_BLK_DEV_INTEGRITY */
540 536
541#define bio_integrity(a) (0) 537#define bio_integrity(a) (0)
542#define bioset_integrity_create(a, b) (0)
543#define bio_integrity_prep(a) (0) 538#define bio_integrity_prep(a) (0)
544#define bio_integrity_enabled(a) (0) 539#define bio_integrity_enabled(a) (0)
545#define bio_integrity_clone(a, b, c,d ) (0) 540#define bio_integrity_clone(a, b, c) (0)
546#define bioset_integrity_free(a) do { } while (0) 541#define bio_integrity_free(a) do { } while (0)
547#define bio_integrity_free(a, b) do { } while (0)
548#define bio_integrity_endio(a, b) do { } while (0) 542#define bio_integrity_endio(a, b) do { } while (0)
549#define bio_integrity_advance(a, b) do { } while (0) 543#define bio_integrity_advance(a, b) do { } while (0)
550#define bio_integrity_trim(a, b, c) do { } while (0) 544#define bio_integrity_trim(a, b, c) do { } while (0)
551#define bio_integrity_split(a, b, c) do { } while (0) 545#define bio_integrity_split(a, b, c) do { } while (0)
552#define bio_integrity_set_tag(a, b, c) do { } while (0) 546#define bio_integrity_set_tag(a, b, c) do { } while (0)
553#define bio_integrity_get_tag(a, b, c) do { } while (0) 547#define bio_integrity_get_tag(a, b, c) do { } while (0)
554#define bio_integrity_init_slab(a) do { } while (0)
555 548
556#endif /* CONFIG_BLK_DEV_INTEGRITY */ 549#endif /* CONFIG_BLK_DEV_INTEGRITY */
557 550