Skip to content

Commit

Permalink
block: re-use existing 'reading' variable instead of checking directi…
Browse files Browse the repository at this point in the history
…on again

Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
majianpeng authored and axboe committed Dec 21, 2011
1 parent 6ae0516 commit 609f6ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 609f6ea

Please sign in to comment.