Merge branch 'tracing-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / include / linux / bio.h
index fb97221d7c30db17da3ac04d8923bfe0e748b79d..1c91a176b9ae8206f872a55a1318fb74048dbdec 100644 (file)
@@ -79,6 +79,13 @@ struct bio {
 
        unsigned int            bi_size;        /* residual I/O count */
 
+       /*
+        * To keep track of the max segment size, we account for the
+        * sizes of the first and last mergeable segments in this bio.
+        */
+       unsigned int            bi_seg_front_size;
+       unsigned int            bi_seg_back_size;
+
        unsigned int            bi_max_vecs;    /* max bvl_vecs we can hold */
 
        unsigned int            bi_comp_cpu;    /* completion CPU */
@@ -123,21 +130,36 @@ struct bio {
 /*
  * bio bi_rw flags
  *
- * bit 0 -- read (not set) or write (set)
+ * bit 0 -- data direction
+ *     If not set, bio is a read from device. If set, it's a write to device.
  * bit 1 -- rw-ahead when set
  * bit 2 -- barrier
- * bit 3 -- fail fast, don't want low level driver retries
- * bit 4 -- synchronous I/O hint: the block layer will unplug immediately
- * bit 5 -- metadata request
- * bit 6 -- discard sectors
+ *     Insert a serialization point in the IO queue, forcing previously
+ *     submitted IO to be completed before this oen is issued.
+ * bit 3 -- synchronous I/O hint: the block layer will unplug immediately
+ *     Note that this does NOT indicate that the IO itself is sync, just
+ *     that the block layer will not postpone issue of this IO by plugging.
+ * bit 4 -- metadata request
+ *     Used for tracing to differentiate metadata and data IO. May also
+ *     get some preferential treatment in the IO scheduler
+ * bit 5 -- discard sectors
+ *     Informs the lower level device that this range of sectors is no longer
+ *     used by the file system and may thus be freed by the device. Used
+ *     for flash based storage.
+ * bit 6 -- fail fast device errors
+ * bit 7 -- fail fast transport errors
+ * bit 8 -- fail fast driver errors
+ *     Don't want driver retries for any fast fail whatever the reason.
  */
 #define BIO_RW         0       /* Must match RW in req flags (blkdev.h) */
 #define BIO_RW_AHEAD   1       /* Must match FAILFAST in req flags */
 #define BIO_RW_BARRIER 2
-#define BIO_RW_FAILFAST        3
-#define BIO_RW_SYNC    4
-#define BIO_RW_META    5
-#define BIO_RW_DISCARD 6
+#define BIO_RW_SYNC    3
+#define BIO_RW_META    4
+#define BIO_RW_DISCARD 5
+#define BIO_RW_FAILFAST_DEV            6
+#define BIO_RW_FAILFAST_TRANSPORT      7
+#define BIO_RW_FAILFAST_DRIVER         8
 
 /*
  * upper 16 bits of bi_rw define the io priority of this bio
@@ -164,7 +186,10 @@ struct bio {
 #define bio_sectors(bio)       ((bio)->bi_size >> 9)
 #define bio_barrier(bio)       ((bio)->bi_rw & (1 << BIO_RW_BARRIER))
 #define bio_sync(bio)          ((bio)->bi_rw & (1 << BIO_RW_SYNC))
-#define bio_failfast(bio)      ((bio)->bi_rw & (1 << BIO_RW_FAILFAST))
+#define bio_failfast_dev(bio)  ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DEV))
+#define bio_failfast_transport(bio)    \
+       ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_TRANSPORT))
+#define bio_failfast_driver(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DRIVER))
 #define bio_rw_ahead(bio)      ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
 #define bio_rw_meta(bio)       ((bio)->bi_rw & (1 << BIO_RW_META))
 #define bio_discard(bio)       ((bio)->bi_rw & (1 << BIO_RW_DISCARD))