Skip to content

Commit f9831b8

Browse files
Christoph Hellwigaxboe
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 946e993 commit f9831b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/partitions/efi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ efi_crc32(const void *buf, unsigned long len)
133133
*/
134134
static u64 last_lba(struct gendisk *disk)
135135
{
136-
return div_u64(disk->part0->bd_inode->i_size,
136+
return div_u64(bdev_nr_bytes(disk->part0),
137137
queue_logical_block_size(disk->queue)) - 1ULL;
138138
}
139139

0 commit comments

Comments
 (0)