This patch introduces a nvme_is_fabrics() inline function to check whether or not the given command structure is for fabrics.
Showing the changes to include/linux (1 of 5 files). Show all
Unified · Split
| @@ -1165,6 +1165,11 @@ struct nvme_command { · 1164 unmodified lines | |||
| 1165 | }; | 1165 | }; |
| 1166 | }; | 1166 | }; |
| 1167 | 1167 | ||
| 1168 | static inline bool nvme_is_fabrics(struct nvme_command *cmd) | ||
| 1169 | { | ||
| 1170 | return cmd->common.opcode == nvme_fabrics_command; | ||
| 1171 | } | ||
| 1172 | |||
| 1168 | struct nvme_error_slot { | 1173 | struct 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 | } |