summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-11-10 07:32:33 -0800
committerJens Axboe <axboe@fb.com>2016-11-10 10:06:24 -0700
commitd49187e97e94e2eb613cb6fed810356972077cc3 (patch)
treefcfb2353034857d86ded315e5ce139a0cd124c06 /include
parent41c9499b221ebe102f776589085cde43d0dadc46 (diff)
downloadlwn-d49187e97e94e2eb613cb6fed810356972077cc3.tar.gz
lwn-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 'include')
-rw-r--r--include/linux/nvme.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 7676557ce357..18ce9f7cc881 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -949,11 +949,11 @@ struct nvme_completion {
/*
* Used by Admin and Fabrics commands to return data:
*/
- union {
- __le16 result16;
- __le32 result;
- __le64 result64;
- };
+ union nvme_result {
+ __le16 u16;
+ __le32 u32;
+ __le64 u64;
+ } result;
__le16 sq_head; /* how much of this queue may be reclaimed */
__le16 sq_id; /* submission queue that generated this entry */
__u16 command_id; /* of the command which completed */