block: refactor blkdev_get
authorChristoph Hellwig <hch@lst.de>
Mon, 23 Nov 2020 09:19:22 +0000 (10:19 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Dec 2020 21:53:39 +0000 (14:53 -0700)
commit5b56b6ed574b583b07da9d824c1eca6d67c1074e
treeadf38195b9fe9213aa0c621e328b9a0cb4e1e721
parentec5d451438a2f24c9b9c33c195bc2c39dcd3d3f0
block: refactor blkdev_get

Move more code that is only run on the outer open but not the open of
the underlying whole device when opening a partition into blkdev_get,
which leads to a much easier to follow structure.

This allows to simplify the disk and module refcounting so that one
reference is held for each open, similar to what we do with normal
file operations.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/block_dev.c