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>
This commit is contained in:
committed by
Jens Axboe
parent
807d4af2f6
commit
c2ee070fb0
@@ -1451,6 +1451,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
|
||||
bdev->bd_disk = disk;
|
||||
bdev->bd_queue = disk->queue;
|
||||
bdev->bd_contains = bdev;
|
||||
bdev->bd_partno = partno;
|
||||
|
||||
if (!partno) {
|
||||
ret = -ENXIO;
|
||||
|
||||
Reference in New Issue
Block a user