aboutsummaryrefslogtreecommitdiff
path: root/block/blk-map.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-08-27 17:37:48 +0200
committerJens Axboe <axboe@kernel.dk>2020-09-01 16:49:26 -0600
commit3310eebafe6f9a872c1f757b3d822dafae9c0cd8 (patch)
tree0555d50aca08c223fc49b2f8b2846e25c31911a3 /block/blk-map.c
parent7589ad6729d6a707c6ce97693106d42cbb121b42 (diff)
block: remove the BIO_USER_MAPPED flag
Just check if there is private data, in which case the bio must have originated from bio_copy_user_iov. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-map.c')
-rw-r--r--block/blk-map.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/block/blk-map.c b/block/blk-map.c
index 427962ac2f67..be118926ccf4 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -109,7 +109,7 @@ static int bio_uncopy_user(struct bio *bio)
struct bio_map_data *bmd = bio->bi_private;
int ret = 0;
- if (!bmd || !bmd->is_null_mapped) {
+ if (!bmd->is_null_mapped) {
/*
* if we're in a workqueue, the request is orphaned, so
* don't copy into a random user address space, just free
@@ -307,8 +307,6 @@ static int bio_map_user_iov(struct request *rq, struct iov_iter *iter,
break;
}
- bio_set_flag(bio, BIO_USER_MAPPED);
-
/*
* Subtle: if we end up needing to bounce a bio, it would normally
* disappear when its bi_end_io is run. However, we need the original
@@ -654,12 +652,12 @@ int blk_rq_unmap_user(struct bio *bio)
if (unlikely(bio_flagged(bio, BIO_BOUNCED)))
mapped_bio = bio->bi_private;
- if (bio_flagged(mapped_bio, BIO_USER_MAPPED)) {
- bio_unmap_user(mapped_bio);
- } else {
+ if (bio->bi_private) {
ret2 = bio_uncopy_user(mapped_bio);
if (ret2 && !ret)
ret = ret2;
+ } else {
+ bio_unmap_user(mapped_bio);
}
mapped_bio = bio;