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
1165 };1165 };
1166};1166};
1167 1167
1168static inline bool nvme_is_fabrics(struct nvme_command *cmd)
1169{
1170 return cmd->common.opcode == nvme_fabrics_command;
1171}
1172
1168struct nvme_error_slot {1173struct nvme_error_slot {
1169 __le64 error_count;1174 __le64 error_count;
1170 __le16 sqid;1175 __le16 sqid;
@@ -1186,7 +1191,7 @@ static inline bool nvme_is_write(struct nvme_command *cmd) · 15 unmodified lines
1186 *1191 *
1187 * Why can't we simply have a Fabrics In and Fabrics out command?1192 * Why can't we simply have a Fabrics In and Fabrics out command?
1188 */1193 */
1189 if (unlikely(cmd->common.opcode == nvme_fabrics_command))1194 if (unlikely(nvme_is_fabrics(cmd)))
1190 return cmd->fabrics.fctype & 1;1195 return cmd->fabrics.fctype & 1;
1191 return cmd->common.opcode & 1;1196 return cmd->common.opcode & 1;
1192}1197}

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