Thread (6 messages) flat view 6 messages, 3 authors, 2021-10-19
STALE1783d LANDED

Landed in mainline as f9831b885709 on 2021-10-19.

[PATCH 2/3] partitions/efi: use bdev_nr_bytes instead of open coding it

From: Christoph Hellwig <hch@lst.de>
Date: 2021-10-19 06:20:40
Also in: linux-efi, linux-s390
Subsystem: block layer, guid partition table (gpt), the rest · Maintainers: Jens Axboe, Davidlohr Bueso, Linus Torvalds

Use the proper helper to read the block device size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/partitions/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/partitions/efi.c b/block/partitions/efi.c
index 7ca5c4c374d4d..5e9be13a56a82 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;
 }
 
-- 
2.30.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help