mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
btrfs: use bdev_nr_bytes instead of open coding it
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Acked-by: David Sterba <dsterba@suse.com> Link: https://lore.kernel.org/r/20211018101130.1838532-13-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
589aa7bc40
commit
cda00eba02
4 changed files with 8 additions and 9 deletions
|
@ -283,8 +283,7 @@ static int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info,
|
|||
}
|
||||
|
||||
|
||||
if (i_size_read(bdev->bd_inode) <
|
||||
btrfs_device_get_total_bytes(srcdev)) {
|
||||
if (bdev_nr_bytes(bdev) < btrfs_device_get_total_bytes(srcdev)) {
|
||||
btrfs_err(fs_info,
|
||||
"target device is smaller than source device!");
|
||||
ret = -EINVAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue