summaryrefslogtreecommitdiffstats
path: root/block/blk-map.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-08-27 17:37:45 +0200
committerJens Axboe <axboe@kernel.dk>2020-09-02 00:49:25 +0200
commitf3256075ba49d80835b601bfbff350a2140b2924 (patch)
tree4ad8f77a103be4dac369b9edc4f9f8340229122e /block/blk-map.c
parentnvme: don't call revalidate_disk from nvme_set_queue_dying (diff)
downloadlinux-f3256075ba49d80835b601bfbff350a2140b2924.tar.xz
linux-f3256075ba49d80835b601bfbff350a2140b2924.zip
block: remove the BIO_NULL_MAPPED flag
We can simply use a boolean flag in the bio_map_data data structure instead. 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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/block/blk-map.c b/block/blk-map.c
index 6e804892d5ec..51e6195f878d 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -12,7 +12,8 @@
#include "blk.h"
struct bio_map_data {
- int is_our_pages;
+ bool is_our_pages : 1;
+ bool is_null_mapped : 1;
struct iov_iter iter;
struct iovec iov[];
};
@@ -108,7 +109,7 @@ static int bio_uncopy_user(struct bio *bio)
struct bio_map_data *bmd = bio->bi_private;
int ret = 0;
- if (!bio_flagged(bio, BIO_NULL_MAPPED)) {
+ if (!bmd || !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
@@ -158,7 +159,7 @@ static struct bio *bio_copy_user_iov(struct request_queue *q,
* The caller provided iov might point to an on-stack or otherwise
* shortlived one.
*/
- bmd->is_our_pages = map_data ? 0 : 1;
+ bmd->is_our_pages = !map_data;
nr_pages = DIV_ROUND_UP(offset + len, PAGE_SIZE);
if (nr_pages > BIO_MAX_PAGES)
@@ -234,7 +235,7 @@ static struct bio *bio_copy_user_iov(struct request_queue *q,
bio->bi_private = bmd;
if (map_data && map_data->null_mapped)
- bio_set_flag(bio, BIO_NULL_MAPPED);
+ bmd->is_null_mapped = true;
return bio;
cleanup:
if (!map_data)