summaryrefslogtreecommitdiffstats
path: root/block/genhd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-08-04 11:41:42 +0200
committerJens Axboe <axboe@kernel.dk>2021-08-09 11:50:42 -0600
commit0dbcfe247f22a6d73302dfa691c48b3c14d31c4c (patch)
treee0954dc2fc3a87f67214da4908f1384ab56a6e86 /block/genhd.c
parentfbd9a39542ecdd2ade55869c13856b2590db3df8 (diff)
downloadlinux-0dbcfe247f22a6d73302dfa691c48b3c14d31c4c.tar.gz
linux-0dbcfe247f22a6d73302dfa691c48b3c14d31c4c.tar.bz2
linux-0dbcfe247f22a6d73302dfa691c48b3c14d31c4c.zip
block: look up holders by bdev
Invert they way the holder relations are tracked. This very slightly reduces the memory overhead for partitioned devices. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20210804094147.459763-4-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/genhd.c b/block/genhd.c
index a4817e42f3a3..cd4eab744667 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1289,7 +1289,9 @@ struct gendisk *__alloc_disk_node(int minors, int node_id)
disk_to_dev(disk)->type = &disk_type;
device_initialize(disk_to_dev(disk));
inc_diskseq(disk);
-
+#ifdef CONFIG_BLOCK_HOLDER_DEPRECATED
+ INIT_LIST_HEAD(&disk->slave_bdevs);
+#endif
return disk;
out_destroy_part_tbl: