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.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index dc3cec386a99..1c91a176b9ae 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -136,25 +136,30 @@ struct bio {
136 * bit 2 -- barrier 136 * bit 2 -- barrier
137 * Insert a serialization point in the IO queue, forcing previously 137 * Insert a serialization point in the IO queue, forcing previously
138 * submitted IO to be completed before this oen is issued. 138 * submitted IO to be completed before this oen is issued.
139 * bit 3 -- fail fast, don't want low level driver retries 139 * bit 3 -- synchronous I/O hint: the block layer will unplug immediately
140 * bit 4 -- synchronous I/O hint: the block layer will unplug immediately
141 * Note that this does NOT indicate that the IO itself is sync, just 140 * Note that this does NOT indicate that the IO itself is sync, just
142 * that the block layer will not postpone issue of this IO by plugging. 141 * that the block layer will not postpone issue of this IO by plugging.
143 * bit 5 -- metadata request 142 * bit 4 -- metadata request
144 * Used for tracing to differentiate metadata and data IO. May also 143 * Used for tracing to differentiate metadata and data IO. May also
145 * get some preferential treatment in the IO scheduler 144 * get some preferential treatment in the IO scheduler
146 * bit 6 -- discard sectors 145 * bit 5 -- discard sectors
147 * Informs the lower level device that this range of sectors is no longer 146 * Informs the lower level device that this range of sectors is no longer
148 * used by the file system and may thus be freed by the device. Used 147 * used by the file system and may thus be freed by the device. Used
149 * for flash based storage. 148 * for flash based storage.
149 * bit 6 -- fail fast device errors
150 * bit 7 -- fail fast transport errors
151 * bit 8 -- fail fast driver errors
152 * Don't want driver retries for any fast fail whatever the reason.
150 */ 153 */
151#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ 154#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */
152#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ 155#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */
153#define BIO_RW_BARRIER 2 156#define BIO_RW_BARRIER 2
154#define BIO_RW_FAILFAST 3 157#define BIO_RW_SYNC 3
155#define BIO_RW_SYNC 4 158#define BIO_RW_META 4
156#define BIO_RW_META 5 159#define BIO_RW_DISCARD 5
157#define BIO_RW_DISCARD 6 160#define BIO_RW_FAILFAST_DEV 6
161#define BIO_RW_FAILFAST_TRANSPORT 7
162#define BIO_RW_FAILFAST_DRIVER 8
158 163
159/* 164/*
160 * upper 16 bits of bi_rw define the io priority of this bio 165 * upper 16 bits of bi_rw define the io priority of this bio
@@ -181,7 +186,10 @@ struct bio {
181#define bio_sectors(bio) ((bio)->bi_size >> 9) 186#define bio_sectors(bio) ((bio)->bi_size >> 9)
182#define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER)) 187#define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER))
183#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) 188#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC))
184#define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) 189#define bio_failfast_dev(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DEV))
190#define bio_failfast_transport(bio) \
191 ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_TRANSPORT))
192#define bio_failfast_driver(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DRIVER))
185#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) 193#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
186#define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) 194#define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META))
187#define bio_discard(bio) ((bio)->bi_rw & (1 << BIO_RW_DISCARD)) 195#define bio_discard(bio) ((bio)->bi_rw & (1 << BIO_RW_DISCARD))