Commit 5513b241 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

ext4: use sb_bdev_nr_blocks

Use the sb_bdev_nr_blocks helper instead of open coding it.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Acked-by: default avatarTheodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20211018101130.1838532-27-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent bcc6e2cf
...@@ -4474,7 +4474,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -4474,7 +4474,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
goto cantfind_ext4; goto cantfind_ext4;
/* check blocks count against device size */ /* check blocks count against device size */
blocks_count = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits; blocks_count = sb_bdev_nr_blocks(sb);
if (blocks_count && ext4_blocks_count(es) > blocks_count) { if (blocks_count && ext4_blocks_count(es) > blocks_count) {
ext4_msg(sb, KERN_WARNING, "bad geometry: block count %llu " ext4_msg(sb, KERN_WARNING, "bad geometry: block count %llu "
"exceeds size of device (%llu blocks)", "exceeds size of device (%llu blocks)",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment