diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2010-02-17 11:18:50 +0100 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-02-17 17:46:19 -0600 |
commit | b6bd2fb92a7bb9f1f3feecd9945c21e6c227dd51 (patch) | |
tree | 764374b8317b504336ef0c9ba4160ff7124c3e10 /drivers/s390/scsi/zfcp_def.h | |
parent | e60a6d69f1f84c2ef1cc63aefaadfe7ae9f12934 (diff) | |
download | op-kernel-dev-b6bd2fb92a7bb9f1f3feecd9945c21e6c227dd51.zip op-kernel-dev-b6bd2fb92a7bb9f1f3feecd9945c21e6c227dd51.tar.gz |
[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.h | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 6ed4865..ff4e2ca1 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -39,9 +39,7 @@ #include <asm/sysinfo.h> #include "zfcp_fsf.h" -/********************* GENERAL DEFINES *********************************/ - -#define REQUEST_LIST_SIZE 128 +struct zfcp_reqlist; /********************* SCSI SPECIFIC DEFINES *********************************/ #define ZFCP_SCSI_ER_TIMEOUT (10*HZ) @@ -206,8 +204,7 @@ struct zfcp_adapter { struct list_head port_list; /* remote port list */ rwlock_t port_list_lock; /* port list lock */ unsigned long req_no; /* unique FSF req number */ - struct list_head *req_list; /* list of pending reqs */ - spinlock_t req_list_lock; /* request list lock */ + struct zfcp_reqlist *req_list; u32 fsf_req_seq_no; /* FSF cmnd seq number */ rwlock_t abort_lock; /* Protects against SCSI stack abort/command @@ -351,31 +348,4 @@ struct zfcp_data { #define ZFCP_SET 0x00000100 #define ZFCP_CLEAR 0x00000200 -/* - * Helper functions for request ID management. - */ -static inline int zfcp_reqlist_hash(unsigned long req_id) -{ - return req_id % REQUEST_LIST_SIZE; -} - -static inline void zfcp_reqlist_remove(struct zfcp_adapter *adapter, - struct zfcp_fsf_req *fsf_req) -{ - list_del(&fsf_req->list); -} - -static inline struct zfcp_fsf_req * -zfcp_reqlist_find(struct zfcp_adapter *adapter, unsigned long req_id) -{ - struct zfcp_fsf_req *request; - unsigned int idx; - - idx = zfcp_reqlist_hash(req_id); - list_for_each_entry(request, &adapter->req_list[idx], list) - if (request->req_id == req_id) - return request; - return NULL; -} - #endif /* ZFCP_DEF_H */ |