projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
807d4af
)
block: cache the partition index in struct block_device
author
Christoph Hellwig
<hch@lst.de>
Wed, 23 Aug 2017 17:10:31 +0000
(19:10 +0200)
committer
Jens Axboe
<axboe@kernel.dk>
Wed, 23 Aug 2017 18:49:53 +0000
(12:49 -0600)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/block_dev.c
patch
|
blob
|
history
include/linux/fs.h
patch
|
blob
|
history
diff --git
a/fs/block_dev.c
b/fs/block_dev.c
index 9941dc8342dfd7671eb96ad27a736d5220d670c8..d29d1c70f833c93d16444383574cd847cc483b1b 100644
(file)
--- a/
fs/block_dev.c
+++ b/
fs/block_dev.c
@@
-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;
diff --git
a/include/linux/fs.h
b/include/linux/fs.h
index 6e1fd5d2124877c16bbbfab4487a772c8f7e37ee..706dd3a972d2293495b1aa2bff5c9114bc455716 100644
(file)
--- a/
include/linux/fs.h
+++ b/
include/linux/fs.h
@@
-427,6
+427,7
@@
struct block_device {
#endif
struct block_device * bd_contains;
unsigned bd_block_size;
+ u8 bd_partno;
struct hd_struct * bd_part;
/* number of times partitions within this device have been opened. */
unsigned bd_part_count;