Skip to content

Commit af56394

Browse files
author
Jens Axboe
committed
block: add some comments around the bio read-write flags
Signed-off-by: Jens Axboe <[email protected]>
1 parent 6feef53 commit af56394

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

include/linux/bio.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,23 @@ struct bio {
123123
/*
124124
* bio bi_rw flags
125125
*
126-
* bit 0 -- read (not set) or write (set)
126+
* bit 0 -- data direction
127+
* If not set, bio is a read from device. If set, it's a write to device.
127128
* bit 1 -- rw-ahead when set
128129
* bit 2 -- barrier
130+
* Insert a serialization point in the IO queue, forcing previously
131+
* submitted IO to be completed before this oen is issued.
129132
* bit 3 -- fail fast, don't want low level driver retries
130133
* bit 4 -- synchronous I/O hint: the block layer will unplug immediately
134+
* Note that this does NOT indicate that the IO itself is sync, just
135+
* that the block layer will not postpone issue of this IO by plugging.
131136
* bit 5 -- metadata request
137+
* Used for tracing to differentiate metadata and data IO. May also
138+
* get some preferential treatment in the IO scheduler
132139
* bit 6 -- discard sectors
140+
* Informs the lower level device that this range of sectors is no longer
141+
* used by the file system and may thus be freed by the device. Used
142+
* for flash based storage.
133143
*/
134144
#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */
135145
#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */

0 commit comments

Comments
 (0)