提交 609f6ea1 编写于 作者: M majianpeng 提交者: Jens Axboe

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

Signed-off-by: Nmajianpeng <majianpeng@gmail.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 6ae0516b
...@@ -311,7 +311,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf, ...@@ -311,7 +311,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
if (IS_ERR(bio)) if (IS_ERR(bio))
return PTR_ERR(bio); return PTR_ERR(bio);
if (rq_data_dir(rq) == WRITE) if (!reading)
bio->bi_rw |= REQ_WRITE; bio->bi_rw |= REQ_WRITE;
if (do_copy) if (do_copy)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册