block: allocate struct hd_struct as part of struct bdev_inode
authorChristoph Hellwig <hch@lst.de>
Thu, 26 Nov 2020 17:47:17 +0000 (18:47 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Dec 2020 21:53:40 +0000 (14:53 -0700)
commitcb8432d650fe3be58bb962bc8e602dc405510327
tree5e893d44ba2449080db89f00098f11259384a56a
parent83950d359010a493462d58c712b1124c877d1b3b
block: allocate struct hd_struct as part of struct bdev_inode

Allocate hd_struct together with struct block_device to pre-load
the lifetime rule changes in preparation of merging the two structures.

Note that part0 was previously embedded into struct gendisk, but is
a separate allocation now, and already points to the block_device instead
of the hd_struct.  The lifetime of struct gendisk is still controlled by
the struct device embedded in the part0 hd_struct.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
15 files changed:
block/blk-core.c
block/blk-flush.c
block/blk-merge.c
block/blk.h
block/genhd.c
block/partitions/core.c
drivers/block/drbd/drbd_receiver.c
drivers/block/drbd/drbd_worker.c
drivers/block/zram/zram_drv.c
drivers/md/dm.c
drivers/md/md.c
fs/block_dev.c
include/linux/blk_types.h
include/linux/genhd.h
include/linux/part_stat.h