]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Fix up comments about matching flags between bio and rq
authorDavid Woodhouse <David.Woodhouse@intel.com>
Sat, 9 Aug 2008 15:22:17 +0000 (16:22 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 9 Oct 2008 06:56:01 +0000 (08:56 +0200)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/blk-core.c
include/linux/bio.h
include/linux/blkdev.h

index b5776c1fd52aca777ae9dc185a936121caf0e8a9..a496727df7ef4b1b4016f961d6350e279677afc9 100644 (file)
@@ -624,10 +624,6 @@ blk_alloc_request(struct request_queue *q, int rw, int priv, gfp_t gfp_mask)
 
        blk_rq_init(q, rq);
 
-       /*
-        * first three bits are identical in rq->cmd_flags and bio->bi_rw,
-        * see bio.h and blkdev.h
-        */
        rq->cmd_flags = rw | REQ_ALLOCED;
 
        if (priv) {
@@ -2012,7 +2008,8 @@ EXPORT_SYMBOL_GPL(blk_end_request_callback);
 void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
                     struct bio *bio)
 {
-       /* first two bits are identical in rq->cmd_flags and bio->bi_rw */
+       /* Bit 0 (R/W) is identical in rq->cmd_flags and bio->bi_rw, and
+          we want BIO_RW_AHEAD (bit 1) to imply REQ_FAILFAST (bit 1). */
        rq->cmd_flags |= (bio->bi_rw & 3);
 
        rq->nr_phys_segments = bio_phys_segments(q, bio);
index dbeb66f813abc01f3fe89b12697d7927ae304649..17f1fbdb31bffff2d56942e188c8e6405cb61553 100644 (file)
@@ -150,8 +150,8 @@ struct bio {
  * bit 3 -- fail fast, don't want low level driver retries
  * bit 4 -- synchronous I/O hint: the block layer will unplug immediately
  */
-#define BIO_RW         0
-#define BIO_RW_AHEAD   1
+#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
index 53ea933cf60bde455e4abc0687e06da638641b8a..e0ba018f5e8856c703f010b7e085a5695d455219 100644 (file)
@@ -84,7 +84,7 @@ enum {
 };
 
 /*
- * request type modified bits. first three bits match BIO_RW* bits, important
+ * request type modified bits. first two bits match BIO_RW* bits, important
  */
 enum rq_flag_bits {
        __REQ_RW,               /* not set, read. set, write */