From 0dbcfe247f22a6d73302dfa691c48b3c14d31c4c Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 4 Aug 2021 11:41:42 +0200 Subject: 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 Link: https://lore.kernel.org/r/20210804094147.459763-4-hch@lst.de Signed-off-by: Jens Axboe --- block/genhd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'block/genhd.c') 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: -- cgit v1.2.3-73-gaa49b