[PATCH 37/45] block: allocate struct hd_struct as part of struct bdev_inode

Hannes Reinecke hare at suse.de
Mon Nov 30 02:46:28 EST 2020


On 11/28/20 5:15 PM, Christoph Hellwig wrote:
> 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 at lst.de>
> ---
>   block/blk-core.c                   | 16 ++++---
>   block/blk-flush.c                  |  2 +-
>   block/blk-merge.c                  |  2 -
>   block/blk.h                        | 21 ----------
>   block/genhd.c                      | 50 +++++++++-------------
>   block/partitions/core.c            | 67 +++---------------------------
>   drivers/block/drbd/drbd_receiver.c |  2 +-
>   drivers/block/drbd/drbd_worker.c   |  3 +-
>   drivers/block/zram/zram_drv.c      |  2 +-
>   drivers/md/dm.c                    |  4 +-
>   drivers/md/md.c                    |  2 +-
>   fs/block_dev.c                     | 39 ++++++-----------
>   include/linux/blk_types.h          |  2 +-
>   include/linux/genhd.h              | 14 +++----
>   include/linux/part_stat.h          |  4 +-
>   15 files changed, 61 insertions(+), 169 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare at suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare at suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer



More information about the linux-mtd mailing list