/* This function walks the list of exchange manager(EM) anchors to select an EM for a new exchange allocation.  */
static struct fc_exch* fc_exch_alloc(struct fc_lport *lport, struct fc_frame *fp)
/* This function walks the list of exchange manager(EM) anchors to select an EM for a new exchange allocation.  */
static struct fc_exch* fc_exch_alloc(struct fc_lport *lport, struct fc_frame *fp)
{
	struct fc_exch_mgr_anchor *ema;
	struct fc_exch *ep;
	list_for_each_entry(ema, &lport->ema_list, ema_list) {
		if (!ema->match || ema->match(fp)) {
			ep = fc_exch_em_alloc(lport, ema->mp);
			if (ep)
				return ep;
		}
	}
	return NULL;
}