nvme: refactor command completion
authorChristoph Hellwig <hch@lst.de>
Tue, 18 Aug 2020 07:11:30 +0000 (09:11 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 21 Aug 2020 23:14:28 +0000 (17:14 -0600)
commit5ddaabe8ed713f148e3d67e99b86d99427aceb5c
treef59dba0c010e262307f7f91fb16f2250df177a85
parent2eb81a3364eada43985efc0641490b73af78d0fa
nvme: refactor command completion

Lift all the code to decide the dispostition of a completed command
from nvme_complete_rq and nvme_failover_req into a new helper, which
returns an emum of the potential actions.  nvme_complete_rq then
just switches on those and calls the proper helper for the action.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/core.c
drivers/nvme/host/multipath.c
drivers/nvme/host/nvme.h