Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hfs: use bdev_nr_sectors 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>
Link: https://lore.kernel.org/r/20211018101130.1838532-16-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
beffd16e 9e48243b

+1 -1
+1 -1
fs/hfs/mdb.c
··· 36 36 37 37 /* default values */ 38 38 *start = 0; 39 - *size = i_size_read(sb->s_bdev->bd_inode) >> 9; 39 + *size = bdev_nr_sectors(sb->s_bdev); 40 40 41 41 if (HFS_SB(sb)->session >= 0) { 42 42 struct cdrom_tocentry te;