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>
This commit is contained in:
majianpeng 2011-12-21 15:27:24 +01:00 committed by Jens Axboe
parent 6ae0516b8a
commit 609f6ea1c9
1 changed files with 1 additions and 1 deletions

View File

@ -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)