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

partitions/efi: use bdev_nr_bytes instead of open coding it

Use the proper helper to read the block device size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211019062024.2171074-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
f9831b88 946e9937

+1 -1
+1 -1
block/partitions/efi.c
··· 133 133 */ 134 134 static u64 last_lba(struct gendisk *disk) 135 135 { 136 - return div_u64(disk->part0->bd_inode->i_size, 136 + return div_u64(bdev_nr_bytes(disk->part0), 137 137 queue_logical_block_size(disk->queue)) - 1ULL; 138 138 } 139 139