Commit 869b2b44 authored by Martin Peschke's avatar Martin Peschke Committed by James Bottomley

[SCSI] zfcp: avoid clutter in erp_dbf

avoid clutter in erp_dbf

cleanup zfcp_fsf_req_dismiss functions:
- avoid clutter in erp_dbf (reqs_active is always 0)
- fold called three-line function into calling function
- add meaningful comment
- coding style
Signed-off-by: default avatarMartin Peschke <mp3@de.ibm.com>
Signed-off-by: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 7b104bcb
...@@ -156,44 +156,30 @@ zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req) ...@@ -156,44 +156,30 @@ zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req)
kfree(fsf_req); kfree(fsf_req);
} }
/** /*
* zfcp_fsf_req_dismiss - dismiss a single fsf request * Never ever call this without shutting down the adapter first.
*/ * Otherwise the adapter would continue using and corrupting s390 storage.
static void zfcp_fsf_req_dismiss(struct zfcp_adapter *adapter, * Included BUG_ON() call to ensure this is done.
struct zfcp_fsf_req *fsf_req, * ERP is supposed to be the only user of this function.
unsigned int counter)
{
u64 dbg_tmp[2];
dbg_tmp[0] = (u64) atomic_read(&adapter->reqs_active);
dbg_tmp[1] = (u64) counter;
debug_event(adapter->erp_dbf, 4, (void *) dbg_tmp, 16);
list_del(&fsf_req->list);
fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
zfcp_fsf_req_complete(fsf_req);
}
/**
* zfcp_fsf_req_dismiss_all - dismiss all remaining fsf requests
*/ */
void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter) void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter)
{ {
struct zfcp_fsf_req *request, *tmp; struct zfcp_fsf_req *fsf_req, *tmp;
unsigned long flags; unsigned long flags;
LIST_HEAD(remove_queue); LIST_HEAD(remove_queue);
unsigned int i, counter; unsigned int i;
BUG_ON(atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status));
spin_lock_irqsave(&adapter->req_list_lock, flags); spin_lock_irqsave(&adapter->req_list_lock, flags);
atomic_set(&adapter->reqs_active, 0); atomic_set(&adapter->reqs_active, 0);
for (i=0; i<REQUEST_LIST_SIZE; i++) for (i = 0; i < REQUEST_LIST_SIZE; i++)
list_splice_init(&adapter->req_list[i], &remove_queue); list_splice_init(&adapter->req_list[i], &remove_queue);
spin_unlock_irqrestore(&adapter->req_list_lock, flags); spin_unlock_irqrestore(&adapter->req_list_lock, flags);
counter = 0; list_for_each_entry_safe(fsf_req, tmp, &remove_queue, list) {
list_for_each_entry_safe(request, tmp, &remove_queue, list) { list_del(&fsf_req->list);
zfcp_fsf_req_dismiss(adapter, request, counter); fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
counter++; zfcp_fsf_req_complete(fsf_req);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment