Commit 609f6ea1 authored by majianpeng's avatar majianpeng Committed by Jens Axboe

block: re-use existing 'reading' variable instead of checking direction again

Signed-off-by: default avatarmajianpeng <>
Signed-off-by: default avatarJens Axboe <>
parent 6ae0516b
......@@ -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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment