dm: use bdev_nr_sectors and bdev_nr_bytes instead of open coding them
authorChristoph Hellwig <hch@lst.de>
Mon, 18 Oct 2021 10:11:05 +0000 (12:11 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Oct 2021 20:43:22 +0000 (14:43 -0600)
commit6dcbb52cddd9e50c8f6625b02a31f6dffc0d1a7b
tree0b62fa76b092b9525da5cbba47eeee7ed90064d0
parentda7b392467da82f8b8cbfe69360e3128688c9ddb
dm: use bdev_nr_sectors and bdev_nr_bytes instead of open coding them

Use the proper helpers to read the block device size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Link: https://lore.kernel.org/r/20211018101130.1838532-6-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
22 files changed:
drivers/md/dm-bufio.c
drivers/md/dm-cache-metadata.c
drivers/md/dm-cache-target.c
drivers/md/dm-clone-target.c
drivers/md/dm-dust.c
drivers/md/dm-ebs-target.c
drivers/md/dm-era-target.c
drivers/md/dm-exception-store.h
drivers/md/dm-flakey.c
drivers/md/dm-integrity.c
drivers/md/dm-linear.c
drivers/md/dm-log-writes.c
drivers/md/dm-log.c
drivers/md/dm-mpath.c
drivers/md/dm-raid.c
drivers/md/dm-switch.c
drivers/md/dm-table.c
drivers/md/dm-thin-metadata.c
drivers/md/dm-thin.c
drivers/md/dm-verity-target.c
drivers/md/dm-writecache.c
drivers/md/dm-zoned-target.c