/* fc_exch_done_locked() - Complete an exchange with the exchange lock held @ep:  */
static int fc_exch_done_locked(struct fc_exch *ep)
/* fc_exch_done_locked() - Complete an exchange with the exchange lock held @ep:  */
static int fc_exch_done_locked(struct fc_exch *ep)
{
	int rc = 1;
	ep->resp = NULL;
	if (ep->state & FC_EX_DONE)
		return rc;
	ep->esb_stat |= ESB_ST_COMPLETE;
	if (!(ep->esb_stat & ESB_ST_REC_QUAL)) {
		ep->state |= FC_EX_DONE;
		if (cancel_delayed_work(&ep->timeout_work))
			atomic_dec(&ep->ex_refcnt);
		rc = 0;
	}
	return rc;
}