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

block: cache the partition index in struct block_device

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
c2ee070f 807d4af2

+2
+1
fs/block_dev.c
··· 1451 1451 bdev->bd_disk = disk; 1452 1452 bdev->bd_queue = disk->queue; 1453 1453 bdev->bd_contains = bdev; 1454 + bdev->bd_partno = partno; 1454 1455 1455 1456 if (!partno) { 1456 1457 ret = -ENXIO;
+1
include/linux/fs.h
··· 427 427 #endif 428 428 struct block_device * bd_contains; 429 429 unsigned bd_block_size; 430 + u8 bd_partno; 430 431 struct hd_struct * bd_part; 431 432 /* number of times partitions within this device have been opened. */ 432 433 unsigned bd_part_count;