diff options
author | Christoph Hellwig <hch@lst.de> | 2021-10-18 12:11:05 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-18 22:43:22 +0200 |
commit | 6dcbb52cddd9e50c8f6625b02a31f6dffc0d1a7b (patch) | |
tree | 0b62fa76b092b9525da5cbba47eeee7ed90064d0 /drivers/md/dm-clone-target.c | |
parent | drbd: use bdev_nr_sectors instead of open coding it (diff) | |
download | linux-6dcbb52cddd9e50c8f6625b02a31f6dffc0d1a7b.tar.xz linux-6dcbb52cddd9e50c8f6625b02a31f6dffc0d1a7b.zip |
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>
Diffstat (limited to 'drivers/md/dm-clone-target.c')
-rw-r--r-- | drivers/md/dm-clone-target.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-clone-target.c b/drivers/md/dm-clone-target.c index edd22e4d65df..4599632d7a84 100644 --- a/drivers/md/dm-clone-target.c +++ b/drivers/md/dm-clone-target.c @@ -1514,7 +1514,7 @@ error: static sector_t get_dev_size(struct dm_dev *dev) { - return i_size_read(dev->bdev->bd_inode) >> SECTOR_SHIFT; + return bdev_nr_sectors(dev->bdev); } /*---------------------------------------------------------------------------*/ |