From b6bd2fb92a7bb9f1f3feecd9945c21e6c227dd51 Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Wed, 17 Feb 2010 11:18:50 +0100 Subject: [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 Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_aux.c | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) (limited to 'drivers/s390/scsi/zfcp_aux.c') diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 9d0c941b7d33..f42da9d57093 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -32,6 +32,7 @@ #include #include "zfcp_ext.h" #include "zfcp_fc.h" +#include "zfcp_reqlist.h" #define ZFCP_BUS_ID_SIZE 20 @@ -49,36 +50,6 @@ static struct kmem_cache *zfcp_cache_hw_align(const char *name, return kmem_cache_create(name, size, roundup_pow_of_two(size), 0, NULL); } -static int zfcp_reqlist_alloc(struct zfcp_adapter *adapter) -{ - int idx; - - adapter->req_list = kcalloc(REQUEST_LIST_SIZE, sizeof(struct list_head), - GFP_KERNEL); - if (!adapter->req_list) - return -ENOMEM; - - for (idx = 0; idx < REQUEST_LIST_SIZE; idx++) - INIT_LIST_HEAD(&adapter->req_list[idx]); - return 0; -} - -/** - * zfcp_reqlist_isempty - is the request list empty - * @adapter: pointer to struct zfcp_adapter - * - * Returns: true if list is empty, false otherwise - */ -int zfcp_reqlist_isempty(struct zfcp_adapter *adapter) -{ - unsigned int idx; - - for (idx = 0; idx < REQUEST_LIST_SIZE; idx++) - if (!list_empty(&adapter->req_list[idx])) - return 0; - return 1; -} - static void __init zfcp_init_device_configure(char *busid, u64 wwpn, u64 lun) { struct ccw_device *cdev; @@ -539,7 +510,8 @@ struct zfcp_adapter *zfcp_adapter_enqueue(struct ccw_device *ccw_device) if (zfcp_allocate_low_mem_buffers(adapter)) goto failed; - if (zfcp_reqlist_alloc(adapter)) + adapter->req_list = zfcp_reqlist_alloc(); + if (!adapter->req_list) goto failed; if (zfcp_dbf_adapter_register(adapter)) @@ -560,8 +532,6 @@ struct zfcp_adapter *zfcp_adapter_enqueue(struct ccw_device *ccw_device) INIT_LIST_HEAD(&adapter->erp_ready_head); INIT_LIST_HEAD(&adapter->erp_running_head); - spin_lock_init(&adapter->req_list_lock); - rwlock_init(&adapter->erp_lock); rwlock_init(&adapter->abort_lock); -- cgit v1.2.3-59-g8ed1b