Skip to content

Commit

Permalink
affs: use bdev_nr_sectors instead of open coding it
Browse files Browse the repository at this point in the history
Use the proper helper to read the block device size.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Oct 18, 2021
1 parent bcd1d06 commit 589aa7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/affs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
* blocks, we will have to change it.
*/

size = i_size_read(sb->s_bdev->bd_inode) >> 9;
size = bdev_nr_sectors(sb->s_bdev);
pr_debug("initial blocksize=%d, #blocks=%d\n", 512, size);

affs_set_blocksize(sb, PAGE_SIZE);
Expand Down

0 comments on commit 589aa7b

Please sign in to comment.