提交 c2ee070f 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

block: cache the partition index in struct block_device

Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 807d4af2
...@@ -1451,6 +1451,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) ...@@ -1451,6 +1451,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
bdev->bd_disk = disk; bdev->bd_disk = disk;
bdev->bd_queue = disk->queue; bdev->bd_queue = disk->queue;
bdev->bd_contains = bdev; bdev->bd_contains = bdev;
bdev->bd_partno = partno;
if (!partno) { if (!partno) {
ret = -ENXIO; ret = -ENXIO;
......
...@@ -427,6 +427,7 @@ struct block_device { ...@@ -427,6 +427,7 @@ struct block_device {
#endif #endif
struct block_device * bd_contains; struct block_device * bd_contains;
unsigned bd_block_size; unsigned bd_block_size;
u8 bd_partno;
struct hd_struct * bd_part; struct hd_struct * bd_part;
/* number of times partitions within this device have been opened. */ /* number of times partitions within this device have been opened. */
unsigned bd_part_count; unsigned bd_part_count;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册