diff options
-rw-r--r-- | block/blk-core.c | 7 | ||||
-rw-r--r-- | include/linux/bio.h | 4 | ||||
-rw-r--r-- | include/linux/blkdev.h | 2 |
3 files changed, 5 insertions, 8 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index b5776c1fd52a..a496727df7ef 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -624,10 +624,6 @@ blk_alloc_request(struct request_queue *q, int rw, int priv, gfp_t gfp_mask) | |||
624 | 624 | ||
625 | blk_rq_init(q, rq); | 625 | blk_rq_init(q, rq); |
626 | 626 | ||
627 | /* | ||
628 | * first three bits are identical in rq->cmd_flags and bio->bi_rw, | ||
629 | * see bio.h and blkdev.h | ||
630 | */ | ||
631 | rq->cmd_flags = rw | REQ_ALLOCED; | 627 | rq->cmd_flags = rw | REQ_ALLOCED; |
632 | 628 | ||
633 | if (priv) { | 629 | if (priv) { |
@@ -2012,7 +2008,8 @@ EXPORT_SYMBOL_GPL(blk_end_request_callback); | |||
2012 | void blk_rq_bio_prep(struct request_queue *q, struct request *rq, | 2008 | void blk_rq_bio_prep(struct request_queue *q, struct request *rq, |
2013 | struct bio *bio) | 2009 | struct bio *bio) |
2014 | { | 2010 | { |
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). */ | ||
2016 | rq->cmd_flags |= (bio->bi_rw & 3); | 2013 | rq->cmd_flags |= (bio->bi_rw & 3); |
2017 | 2014 | ||
2018 | rq->nr_phys_segments = bio_phys_segments(q, bio); | 2015 | rq->nr_phys_segments = bio_phys_segments(q, bio); |
diff --git a/include/linux/bio.h b/include/linux/bio.h index dbeb66f813ab..17f1fbdb31bf 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -150,8 +150,8 @@ struct bio { | |||
150 | * bit 3 -- fail fast, don't want low level driver retries | 150 | * bit 3 -- fail fast, don't want low level driver retries |
151 | * bit 4 -- synchronous I/O hint: the block layer will unplug immediately | 151 | * bit 4 -- synchronous I/O hint: the block layer will unplug immediately |
152 | */ | 152 | */ |
153 | #define BIO_RW 0 | 153 | #define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ |
154 | #define BIO_RW_AHEAD 1 | 154 | #define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ |
155 | #define BIO_RW_BARRIER 2 | 155 | #define BIO_RW_BARRIER 2 |
156 | #define BIO_RW_FAILFAST 3 | 156 | #define BIO_RW_FAILFAST 3 |
157 | #define BIO_RW_SYNC 4 | 157 | #define BIO_RW_SYNC 4 |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 53ea933cf60b..e0ba018f5e88 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -84,7 +84,7 @@ enum { | |||
84 | }; | 84 | }; |
85 | 85 | ||
86 | /* | 86 | /* |
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 |
88 | */ | 88 | */ |
89 | enum rq_flag_bits { | 89 | enum rq_flag_bits { |
90 | __REQ_RW, /* not set, read. set, write */ | 90 | __REQ_RW, /* not set, read. set, write */ |