Commit f9831b88 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

partitions/efi: use bdev_nr_bytes instead of open coding it

Use the proper helper to read the block device size.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211019062024.2171074-3-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 946e9937
......@@ -133,7 +133,7 @@ efi_crc32(const void *buf, unsigned long len)
*/
static u64 last_lba(struct gendisk *disk)
{
return div_u64(disk->part0->bd_inode->i_size,
return div_u64(bdev_nr_bytes(disk->part0),
queue_logical_block_size(disk->queue)) - 1ULL;
}
......
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