浏览代码

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>
majianpeng 13 年之前
父节点
当前提交
609f6ea1c9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      block/blk-map.c

+ 1 - 1
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)