History

nvme: introduce nvme_is_fabrics to check fabrics cmd

This patch introduces a nvme_is_fabrics() inline function to check whether or not the given command structure is for fabrics.

Minwoo Im committed 7 years ago

Commit 7a1f46e1 parent 1a87ee65 files · +10 −5Browse files

Showing the changes to include/linux (1 of 5 files). Show all

Unified · Split

include/linux/nvme.h+6−1
@@ -1165,6 +1165,11 @@ struct nvme_command { · 1164 unmodified lines
11651165 };
11661166 };
11671167
1168+static inline bool nvme_is_fabrics(struct nvme_command *cmd)
1169+{
1170+ return cmd->common.opcode == nvme_fabrics_command;
1171+}
1172+
11681173 struct nvme_error_slot {
11691174 __le64 error_count;
11701175 __le16 sqid;
@@ -1186,7 +1191,7 @@ static inline bool nvme_is_write(struct nvme_command *cmd) · 15 unmodified lines
11861191 *
11871192 * Why can't we simply have a Fabrics In and Fabrics out command?
11881193 */
1189− if (unlikely(cmd->common.opcode == nvme_fabrics_command))
1194+ if (unlikely(nvme_is_fabrics(cmd)))
11901195 return cmd->fabrics.fctype & 1;
11911196 return cmd->common.opcode & 1;
11921197 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t