ublk_drv: move ublk_get_device_from_id into ublk_ctrl_uring_cmd
authorMing Lei <ming.lei@redhat.com>
Fri, 6 Jan 2023 04:17:08 +0000 (12:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:24:06 +0000 (10:24 +0200)
commitc741076a3c76018ae41f8750fcce1b6662a61db2
treeda41d4788cf6101fed89077dbab2b2e39a06c5ca
parenta39bf13f86403c0e9d9830a5ea30be420c6504b5
ublk_drv: move ublk_get_device_from_id into ublk_ctrl_uring_cmd

[ Upstream commit bfbcef036396a73fbf4b3fee385cc670159df5ad ]

It is annoying for each control command handler to get/put ublk
device and deal with failure.

Control command handler is simplified a lot by moving
ublk_get_device_from_id into ublk_ctrl_uring_cmd().

Reviewed-by: ZiyangZhang <ZiyangZhang@linux.alibaba.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20230106041711.914434-4-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: 53e7d08f6d6e ("ublk: fail to start device if queue setup is interrupted")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/ublk_drv.c