diff options
| author | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-03-21 09:48:57 -0400 |
|---|---|---|
| committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-11-04 15:53:01 -0400 |
| commit | 6c7d49455ceb63064f992347d9185ff5bf43497a (patch) | |
| tree | 8a5fde81a68cd41c12079d8c2baf7ea1cf3e40fe /include/linux | |
| parent | 9d4af1b7796ba02b73a79a8694399e5a3cd1c55d (diff) | |
NVMe: Change the definition of nvme_user_io
The read and write commands don't define a 'result', so there's no need
to copy it back to userspace.
Remove the ability of the ioctl to submit commands to a different
namespace; it's just asking for trouble, and the use case I have in mind
will be addressed througha different ioctl in the future. That removes
the need for both the block_shift and nsid arguments.
Check that the opcode is one of 'read' or 'write'. Future opcodes may
be added in the future, but we will need a different structure definition
for them.
The nblocks field is redefined to be 0-based. This allows the user to
request the full 65536 blocks.
Don't byteswap the reftag, apptag and appmask. Martin Petersen tells
me these are calculated in big-endian and are transmitted to the device
in big-endian.
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/nvme.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/include/linux/nvme.h b/include/linux/nvme.h index fd10d597cca7..347ad5f9a721 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h | |||
| @@ -373,17 +373,15 @@ struct nvme_user_io { | |||
| 373 | __u8 opcode; | 373 | __u8 opcode; |
| 374 | __u8 flags; | 374 | __u8 flags; |
| 375 | __u16 control; | 375 | __u16 control; |
| 376 | __u32 nsid; | 376 | __u16 nblocks; |
| 377 | __u16 rsvd; | ||
| 377 | __u64 metadata; | 378 | __u64 metadata; |
| 378 | __u64 addr; | 379 | __u64 addr; |
| 379 | __u64 slba; | 380 | __u64 slba; |
| 380 | __u16 nblocks; | ||
| 381 | __u16 block_shift; | ||
| 382 | __u32 dsmgmt; | 381 | __u32 dsmgmt; |
| 383 | __u32 reftag; | 382 | __u32 reftag; |
| 384 | __u16 apptag; | 383 | __u16 apptag; |
| 385 | __u16 appmask; | 384 | __u16 appmask; |
| 386 | __u32 result; | ||
| 387 | }; | 385 | }; |
| 388 | 386 | ||
| 389 | struct nvme_dlfw { | 387 | struct nvme_dlfw { |
| @@ -395,7 +393,7 @@ struct nvme_dlfw { | |||
| 395 | #define NVME_IOCTL_IDENTIFY_NS _IOW('N', 0x40, struct nvme_id_ns) | 393 | #define NVME_IOCTL_IDENTIFY_NS _IOW('N', 0x40, struct nvme_id_ns) |
| 396 | #define NVME_IOCTL_IDENTIFY_CTRL _IOW('N', 0x41, struct nvme_id_ctrl) | 394 | #define NVME_IOCTL_IDENTIFY_CTRL _IOW('N', 0x41, struct nvme_id_ctrl) |
| 397 | #define NVME_IOCTL_GET_RANGE_TYPE _IOW('N', 0x42, struct nvme_lba_range_type) | 395 | #define NVME_IOCTL_GET_RANGE_TYPE _IOW('N', 0x42, struct nvme_lba_range_type) |
| 398 | #define NVME_IOCTL_SUBMIT_IO _IOWR('N', 0x43, struct nvme_user_io) | 396 | #define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x43, struct nvme_user_io) |
| 399 | #define NVME_IOCTL_DOWNLOAD_FW _IOW('N', 0x44, struct nvme_dlfw) | 397 | #define NVME_IOCTL_DOWNLOAD_FW _IOW('N', 0x44, struct nvme_dlfw) |
| 400 | #define NVME_IOCTL_ACTIVATE_FW _IO('N', 0x45) | 398 | #define NVME_IOCTL_ACTIVATE_FW _IO('N', 0x45) |
| 401 | 399 | ||
