提交 a0763b27 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

block: handle the null_mapped flag correctly in blk_rq_map_user_iov

The tape drivers (and the sg driver in a special case that doesn't matter
here) use the null_mapped flag to tell blk_rq_map_user to not copy around
any data into or out of the bounce buffers.  blk_rq_map_user_iov never
got that treatment, which didn't matter until I refactored blk_rq_map_user
to be implemented in terms of blk_rq_map_user_iov.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Fixes: ddad8dd0 ("block: use blk_rq_map_user_iov to implement blk_rq_map_user")
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 564e559f
...@@ -93,6 +93,9 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, ...@@ -93,6 +93,9 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
if (IS_ERR(bio)) if (IS_ERR(bio))
return PTR_ERR(bio); return PTR_ERR(bio);
if (map_data && map_data->null_mapped)
bio->bi_flags |= (1 << BIO_NULL_MAPPED);
if (bio->bi_iter.bi_size != iter->count) { if (bio->bi_iter.bi_size != iter->count) {
/* /*
* Grab an extra reference to this bio, as bio_unmap_user() * Grab an extra reference to this bio, as bio_unmap_user()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册