/* fc_exch_mgr_list_clone() - Share all exchange manager objects @src: Source lport to clone exchange managers from @dst: New lport that takes references to all the exchange managers  */
int fc_exch_mgr_list_clone(struct fc_lport *src, struct fc_lport *dst)
/* fc_exch_mgr_list_clone() - Share all exchange manager objects @src: Source lport to clone exchange managers from @dst: New lport that takes references to all the exchange managers  */
int fc_exch_mgr_list_clone(struct fc_lport *src, struct fc_lport *dst)
{
	struct fc_exch_mgr_anchor *ema, *tmp;
	list_for_each_entry(ema, &src->ema_list, ema_list) {
		if (!fc_exch_mgr_add(dst, ema->mp, ema->match))
			goto err;
	}
	return 0;
err:
	list_for_each_entry_safe(ema, tmp, &dst->ema_list, ema_list)
		fc_exch_mgr_del(ema);
	return -ENOMEM;
}