Skip to content

Commit

Permalink
hfsplus: 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]>
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 beffd16 commit 78ed961
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/hfsplus/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static int hfsplus_get_last_session(struct super_block *sb,

/* default values */
*start = 0;
*size = i_size_read(sb->s_bdev->bd_inode) >> 9;
*size = bdev_nr_sectors(sb->s_bdev);

if (HFSPLUS_SB(sb)->session >= 0) {
struct cdrom_tocentry te;
Expand Down

0 comments on commit 78ed961

Please sign in to comment.