diff options
author | Christoph Hellwig <hch@lst.de> | 2016-11-10 16:32:33 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-11-10 18:06:24 +0100 |
commit | d49187e97e94e2eb613cb6fed810356972077cc3 (patch) | |
tree | fcfb2353034857d86ded315e5ce139a0cd124c06 /drivers/nvme/target/nvmet.h | |
parent | skd: fix function prototype (diff) | |
download | linux-d49187e97e94e2eb613cb6fed810356972077cc3.tar.xz linux-d49187e97e94e2eb613cb6fed810356972077cc3.zip |
nvme: introduce struct nvme_request
This adds a shared per-request structure for all NVMe I/O. This structure
is embedded as the first member in all NVMe transport drivers request
private data and allows to implement common functionality between the
drivers.
The first use is to replace the current abuse of the SCSI command
passthrough fields in struct request for the NVMe command passthrough,
but it will grow a field more fields to allow implementing things
like common abort handlers in the future.
The passthrough commands are handled by having a pointer to the SQE
(struct nvme_command) in struct nvme_request, and the union of the
possible result fields, which had to be turned from an anonymous
into a named union for that purpose. This avoids having to pass
a reference to a full CQE around and thus makes checking the result
a lot more lightweight.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/target/nvmet.h')
-rw-r--r-- | drivers/nvme/target/nvmet.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h index 76b6eedccaf9..f9c76441e8c9 100644 --- a/drivers/nvme/target/nvmet.h +++ b/drivers/nvme/target/nvmet.h @@ -238,7 +238,7 @@ static inline void nvmet_set_status(struct nvmet_req *req, u16 status) static inline void nvmet_set_result(struct nvmet_req *req, u32 result) { - req->rsp->result = cpu_to_le32(result); + req->rsp->result.u32 = cpu_to_le32(result); } /* |