nvme: use driver pdu command for passthrough
authorKeith Busch <kbusch@kernel.org>
Wed, 17 Mar 2021 20:37:03 +0000 (13:37 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 18 Mar 2021 05:17:51 +0000 (06:17 +0100)
commit7ad3bbb443acd69d4864b3f47d1255567a429726
tree68b0bea66238ca014600ab561e3ccda385b2be1e
parent089c5da559ad0710a4af6bdb378ea340b870f4e5
nvme: use driver pdu command for passthrough

All nvme transport drivers preallocate an nvme command for each request.
Assume to use that command for nvme_setup_cmd() instead of requiring
drivers pass a pointer to it. All nvme drivers must initialize the
generic nvme_request 'cmd' to point to the transport's preallocated
nvme_command.

The generic nvme_request cmd pointer had previously been used only as a
temporary copy for passthrough commands. Since it now points to the
command that gets dispatched, passthrough commands must directly set it
up prior to executing the request.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/fc.c
drivers/nvme/host/nvme.h
drivers/nvme/host/pci.c
drivers/nvme/host/rdma.c
drivers/nvme/host/tcp.c
drivers/nvme/target/loop.c