block: change the refcounting for partitions
authorChristoph Hellwig <hch@lst.de>
Thu, 22 Jul 2021 07:53:58 +0000 (09:53 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 2 Aug 2021 19:37:28 +0000 (13:37 -0600)
commit9d3b8813895d737fcef4ec8df518f67e5cc381b8
tree13db699bd15205a45a9b571c4d8643000f9b61dc
parent0468c5323413c6903e4cbcef841a55e6c5578cd2
block: change the refcounting for partitions

Instead of acquiring an inode reference on open make sure partitions
always hold device model references to the disk while alive, and switch
open to grab only a device model reference to the opened block device.
If that is a partition the disk reference is transitively held by the
partition already.

Link: https://lore.kernel.org/r/20210722075402.983367-6-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/partitions/core.c
fs/block_dev.c