aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_def.h
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2010-02-17 05:18:50 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-02-17 18:46:19 -0500
commitb6bd2fb92a7bb9f1f3feecd9945c21e6c227dd51 (patch)
tree764374b8317b504336ef0c9ba4160ff7124c3e10 /drivers/s390/scsi/zfcp_def.h
parente60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934 (diff)
[SCSI] zfcp: Move FSF request tracking code to new file
Move the code for tracking FSF requests to new file to have this code in one place. The functions for adding and removing requests on the I/O path are already inline. The alloc and free functions are only called once, so it does not hurt to inline them and add them to the same file. Reviewed-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_def.h')
-rw-r--r--drivers/s390/scsi/zfcp_def.h34
1 files changed, 2 insertions, 32 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 6ed48654c299..ff4e2ca19beb 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -39,9 +39,7 @@
39#include <asm/sysinfo.h> 39#include <asm/sysinfo.h>
40#include "zfcp_fsf.h" 40#include "zfcp_fsf.h"
41 41
42/********************* GENERAL DEFINES *********************************/ 42struct zfcp_reqlist;
43
44#define REQUEST_LIST_SIZE 128
45 43
46/********************* SCSI SPECIFIC DEFINES *********************************/ 44/********************* SCSI SPECIFIC DEFINES *********************************/
47#define ZFCP_SCSI_ER_TIMEOUT (10*HZ) 45#define ZFCP_SCSI_ER_TIMEOUT (10*HZ)
@@ -206,8 +204,7 @@ struct zfcp_adapter {
206 struct list_head port_list; /* remote port list */ 204 struct list_head port_list; /* remote port list */
207 rwlock_t port_list_lock; /* port list lock */ 205 rwlock_t port_list_lock; /* port list lock */
208 unsigned long req_no; /* unique FSF req number */ 206 unsigned long req_no; /* unique FSF req number */
209 struct list_head *req_list; /* list of pending reqs */ 207 struct zfcp_reqlist *req_list;
210 spinlock_t req_list_lock; /* request list lock */
211 u32 fsf_req_seq_no; /* FSF cmnd seq number */ 208 u32 fsf_req_seq_no; /* FSF cmnd seq number */
212 rwlock_t abort_lock; /* Protects against SCSI 209 rwlock_t abort_lock; /* Protects against SCSI
213 stack abort/command 210 stack abort/command
@@ -351,31 +348,4 @@ struct zfcp_data {
351#define ZFCP_SET 0x00000100 348#define ZFCP_SET 0x00000100
352#define ZFCP_CLEAR 0x00000200 349#define ZFCP_CLEAR 0x00000200
353 350
354/*
355 * Helper functions for request ID management.
356 */
357static inline int zfcp_reqlist_hash(unsigned long req_id)
358{
359 return req_id % REQUEST_LIST_SIZE;
360}
361
362static inline void zfcp_reqlist_remove(struct zfcp_adapter *adapter,
363 struct zfcp_fsf_req *fsf_req)
364{
365 list_del(&fsf_req->list);
366}
367
368static inline struct zfcp_fsf_req *
369zfcp_reqlist_find(struct zfcp_adapter *adapter, unsigned long req_id)
370{
371 struct zfcp_fsf_req *request;
372 unsigned int idx;
373
374 idx = zfcp_reqlist_hash(req_id);
375 list_for_each_entry(request, &adapter->req_list[idx], list)
376 if (request->req_id == req_id)
377 return request;
378 return NULL;
379}
380
381#endif /* ZFCP_DEF_H */ 351#endif /* ZFCP_DEF_H */