History

Fix up comments about matching flags between bio and rq

David Woodhouse committed 18 years ago

Commit d628eae1 parent 36144073 files · +5 −8Browse files

Unified · Split

3 files
  1. block/blk-core.c +2 −5
  2. include/linux/bio.h +2 −2
  3. include/linux/blkdev.h +1 −1
block/blk-core.c+2−5
@@ -624,10 +624,6 @@ blk_alloc_request(struct request_queue *q, int rw, int priv, gfp_t gfp_mask) · 623 unmodified lines
624624
625625 blk_rq_init(q, rq);
626626
627− /*
628− * first three bits are identical in rq->cmd_flags and bio->bi_rw,
629− * see bio.h and blkdev.h
630− */
631627 rq->cmd_flags = rw | REQ_ALLOCED;
632628
633629 if (priv) {
@@ -2012,7 +2008,8 @@ EXPORT_SYMBOL_GPL(blk_end_request_callback); · 1378 unmodified lines
20122008 void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
20132009 struct bio *bio)
20142010 {
2015− /* first two bits are identical in rq->cmd_flags and bio->bi_rw */
2011+ /* Bit 0 (R/W) is identical in rq->cmd_flags and bio->bi_rw, and
2012+ we want BIO_RW_AHEAD (bit 1) to imply REQ_FAILFAST (bit 1). */
20162013 rq->cmd_flags |= (bio->bi_rw & 3);
20172014
20182015 rq->nr_phys_segments = bio_phys_segments(q, bio);
include/linux/bio.h+2−2
@@ -150,8 +150,8 @@ struct bio { · 149 unmodified lines
150150 * bit 3 -- fail fast, don't want low level driver retries
151151 * bit 4 -- synchronous I/O hint: the block layer will unplug immediately
152152 */
153−#define BIO_RW 0
154−#define BIO_RW_AHEAD 1
153+#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */
154+#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */
155155 #define BIO_RW_BARRIER 2
156156 #define BIO_RW_FAILFAST 3
157157 #define BIO_RW_SYNC 4
include/linux/blkdev.h+1−1
@@ -84,7 +84,7 @@ enum { · 83 unmodified lines
8484 };
8585
8686 /*
87− * request type modified bits. first three bits match BIO_RW* bits, important
87+ * request type modified bits. first two bits match BIO_RW* bits, important
8888 */
8989 enum rq_flag_bits {
9090 __REQ_RW, /* not set, read. set, write */