summaryrefslogtreecommitdiffstats
path: root/block/blk-map.c
diff options
context:
space:
mode:
authormajianpeng <majianpeng@gmail.com>2011-12-21 15:27:24 +0100
committerJens Axboe <axboe@kernel.dk>2011-12-21 15:27:24 +0100
commit609f6ea1c9cdfe0c43a927e13205a57d0c266d5a (patch)
tree4bb34c0004e1650ee44f23105dc9362908470282 /block/blk-map.c
parentblock, cfq: fix empty queue crash caused by request merge (diff)
downloadlinux-609f6ea1c9cdfe0c43a927e13205a57d0c266d5a.tar.xz
linux-609f6ea1c9cdfe0c43a927e13205a57d0c266d5a.zip
block: re-use existing 'reading' variable instead of checking direction again
Signed-off-by: majianpeng <majianpeng@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-map.c')
-rw-r--r--block/blk-map.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-map.c b/block/blk-map.c
index 164cd0059706..623e1cd4cffe 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -311,7 +311,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
if (IS_ERR(bio))
return PTR_ERR(bio);
- if (rq_data_dir(rq) == WRITE)
+ if (!reading)
bio->bi_rw |= REQ_WRITE;
if (do_copy)