dm: cleanup open_table_device
authorChristoph Hellwig <hch@lst.de>
Tue, 15 Nov 2022 14:10:47 +0000 (22:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:12 +0000 (13:32 +0100)
commit3a3742f6b0a2fe026e721c0759160cc592b21b58
treee85eeed4bcdc1d0715d5bfd6710b3eff170e065c
parent475bdd75447acd9e771addf4c15d14a2d483d5c8
dm: cleanup open_table_device

[ Upstream commit b9a785d2dc6567b2fd9fc60057a6a945a276927a ]

Move all the logic for allocation the table_device and linking it into
the list into the open_table_device.  This keeps the code tidy and
ensures that the table_devices only exist in fully initialized state.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Mike Snitzer <snitzer@kernel.org>
Link: https://lore.kernel.org/r/20221115141054.1051801-4-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: 1a581b721699 ("dm: track per-add_disk holder relations in DM")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm.c