diff options
author | Christoph Hellwig <hch@lst.de> | 2021-10-19 08:20:23 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-19 14:16:50 +0200 |
commit | f9831b885709978ed9d16833ceeb3a2ec174a2d2 (patch) | |
tree | 9ae37a9dcdfa8c64cae17f9379391ce150b889e3 | |
parent | block/ioctl: use bdev_nr_sectors and bdev_nr_bytes (diff) | |
download | linux-f9831b885709978ed9d16833ceeb3a2ec174a2d2.tar.xz linux-f9831b885709978ed9d16833ceeb3a2ec174a2d2.zip |
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>
-rw-r--r-- | block/partitions/efi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/partitions/efi.c b/block/partitions/efi.c index 7ca5c4c374d4..5e9be13a56a8 100644 --- a/block/partitions/efi.c +++ b/block/partitions/efi.c @@ -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; } |