diff options
author | Christoph Hellwig <hch@lst.de> | 2016-06-07 00:20:49 +0300 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-06-12 16:29:43 +0300 |
commit | 7a5abb4b48570c3552e33ff4c72ae1e8dac3ba15 (patch) | |
tree | 00d0e86f8fad328d1e788c060c8b9687bc5f898a /include | |
parent | a229dbf61e03b70d98f5ed46f476d6369870a6ab (diff) | |
download | linux-7a5abb4b48570c3552e33ff4c72ae1e8dac3ba15.tar.xz |
nvme: factor out a add nvme_is_write helper
Centralize the check if a given NVMe command reads or writes data.
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Jay Freyensee <james.p.freyensee@intel.com>
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.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 2b82f05fe4ec..dc815cc6718d 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -590,6 +590,11 @@ struct nvme_command { }; }; +static inline bool nvme_is_write(struct nvme_command *cmd) +{ + return cmd->common.opcode & 1; +} + enum { NVME_SC_SUCCESS = 0x0, NVME_SC_INVALID_OPCODE = 0x1, |