diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_def.h')
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 07b0957b82f3..22649639230b 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -1090,6 +1090,42 @@ extern void _zfcp_hex_dump(char *, int); | |||
1090 | #define zfcp_get_busid_by_unit(unit) (zfcp_get_busid_by_port(unit->port)) | 1090 | #define zfcp_get_busid_by_unit(unit) (zfcp_get_busid_by_port(unit->port)) |
1091 | 1091 | ||
1092 | /* | 1092 | /* |
1093 | * Helper functions for request ID management. | ||
1094 | */ | ||
1095 | static inline int zfcp_reqlist_hash(unsigned long req_id) | ||
1096 | { | ||
1097 | return req_id % REQUEST_LIST_SIZE; | ||
1098 | } | ||
1099 | |||
1100 | static inline void zfcp_reqlist_add(struct zfcp_adapter *adapter, | ||
1101 | struct zfcp_fsf_req *fsf_req) | ||
1102 | { | ||
1103 | unsigned int idx; | ||
1104 | |||
1105 | idx = zfcp_reqlist_hash(fsf_req->req_id); | ||
1106 | list_add_tail(&fsf_req->list, &adapter->req_list[idx]); | ||
1107 | } | ||
1108 | |||
1109 | static inline void zfcp_reqlist_remove(struct zfcp_adapter *adapter, | ||
1110 | struct zfcp_fsf_req *fsf_req) | ||
1111 | { | ||
1112 | list_del(&fsf_req->list); | ||
1113 | } | ||
1114 | |||
1115 | static inline struct zfcp_fsf_req * | ||
1116 | zfcp_reqlist_find(struct zfcp_adapter *adapter, unsigned long req_id) | ||
1117 | { | ||
1118 | struct zfcp_fsf_req *request; | ||
1119 | unsigned int idx; | ||
1120 | |||
1121 | idx = zfcp_reqlist_hash(req_id); | ||
1122 | list_for_each_entry(request, &adapter->req_list[idx], list) | ||
1123 | if (request->req_id == req_id) | ||
1124 | return request; | ||
1125 | return NULL; | ||
1126 | } | ||
1127 | |||
1128 | /* | ||
1093 | * functions needed for reference/usage counting | 1129 | * functions needed for reference/usage counting |
1094 | */ | 1130 | */ |
1095 | 1131 | ||