mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-21 04:53:46 -04:00
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>
This commit is contained in:
committed by
Jens Axboe
parent
a229dbf61e
commit
7a5abb4b48
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user