aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bio.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-01-24 11:02:36 +0100
committerJens Axboe <axboe@kernel.dk>2021-01-24 18:17:20 -0700
commit30c5d3456c272f0de0d7e7eb9fc355fa64a5f649 (patch)
tree8901f97019c05ddd88c2efa9994c7943519107d1 /include/linux/bio.h
parentblock: simplify submit_bio_checks a bit (diff)
downloadlinux-dev-30c5d3456c272f0de0d7e7eb9fc355fa64a5f649.tar.xz
linux-dev-30c5d3456c272f0de0d7e7eb9fc355fa64a5f649.zip
block: do not reassig ->bi_bdev when partition remapping
There is no good reason to reassign ->bi_bdev when remapping the partition-relative block number to the device wide one, as all the information required by the drivers comes from the gendisk anyway. Keeping the original ->bi_bdev alive will allow to greatly simplify the partition-away I/O accounting. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r--include/linux/bio.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 12af7aa5db37..2f1155eabaff 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -485,6 +485,7 @@ extern const char *bio_devname(struct bio *bio, char *buffer);
#define bio_set_dev(bio, bdev) \
do { \
+ bio_clear_flag(bio, BIO_REMAPPED); \
if ((bio)->bi_bdev != (bdev)) \
bio_clear_flag(bio, BIO_THROTTLED); \
(bio)->bi_bdev = (bdev); \
@@ -493,6 +494,7 @@ do { \
#define bio_copy_dev(dst, src) \
do { \
+ bio_clear_flag(dst, BIO_REMAPPED); \
(dst)->bi_bdev = (src)->bi_bdev; \
bio_clone_blkg_association(dst, src); \
} while (0)