/** * zfcp_qdio_reqid_check - checks for valid reqids. */ static void zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, unsigned long req_id) { struct zfcp_fsf_req *fsf_req; unsigned long flags; debug_long_event(adapter->erp_dbf, 4, req_id); spin_lock_irqsave(&adapter->req_list_lock, flags); fsf_req = zfcp_reqlist_find(adapter, req_id); if (!fsf_req) /* * Unknown request means that we have potentially memory * corruption and must stop the machine immediatly. */ panic("error: unknown request id (%ld) on adapter %s.\n", req_id, zfcp_get_busid_by_adapter(adapter)); zfcp_reqlist_remove(adapter, fsf_req); atomic_dec(&adapter->reqs_active); spin_unlock_irqrestore(&adapter->req_list_lock, flags); /* finish the FSF request */ zfcp_fsf_req_complete(fsf_req); }
/** * zfcp_qdio_reqid_check - checks for valid reqids or unsolicited status */ static int zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, unsigned long req_id) { struct zfcp_fsf_req *fsf_req; unsigned long flags; debug_long_event(adapter->erp_dbf, 4, req_id); spin_lock_irqsave(&adapter->req_list_lock, flags); fsf_req = zfcp_reqlist_ismember(adapter, req_id); if (!fsf_req) { spin_unlock_irqrestore(&adapter->req_list_lock, flags); ZFCP_LOG_NORMAL("error: unknown request id (%ld).\n", req_id); zfcp_erp_adapter_reopen(adapter, 0); return -EINVAL; } zfcp_reqlist_remove(adapter, req_id); atomic_dec(&adapter->reqs_active); spin_unlock_irqrestore(&adapter->req_list_lock, flags); /* finish the FSF request */ zfcp_fsf_req_complete(fsf_req); return 0; }