jfs: use sb_bdev_nr_blocks

Use the sb_bdev_nr_blocks helper instead of open coding it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Link: https://lore.kernel.org/r/20211018101130.1838532-28-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Christoph Hellwig 2021-10-18 12:11:27 +02:00 committed by Jens Axboe
parent 5513b241b2
commit dd0c0bdf97
2 changed files with 2 additions and 4 deletions

View File

@ -86,8 +86,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
goto out; goto out;
} }
VolumeSize = i_size_read(sb->s_bdev->bd_inode) >> sb->s_blocksize_bits; VolumeSize = sb_bdev_nr_blocks(sb);
if (VolumeSize) { if (VolumeSize) {
if (newLVSize > VolumeSize) { if (newLVSize > VolumeSize) {
printk(KERN_WARNING "jfs_extendfs: invalid size\n"); printk(KERN_WARNING "jfs_extendfs: invalid size\n");

View File

@ -284,8 +284,7 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
} }
case Opt_resize_nosize: case Opt_resize_nosize:
{ {
*newLVSize = i_size_read(sb->s_bdev->bd_inode) >> *newLVSize = sb_bdev_nr_blocks(sb);
sb->s_blocksize_bits;
if (*newLVSize == 0) if (*newLVSize == 0)
pr_err("JFS: Cannot determine volume size\n"); pr_err("JFS: Cannot determine volume size\n");
break; break;