Commit 3e22760d authored by Vasu Dev's avatar Vasu Dev Committed by James Bottomley

[SCSI] libfc: use offload EM instance again instead jumping to next EM

Since use of offloads is more efficient than switching
to non-offload EM. However kept logic same to call em_match
if it is provided in the list of EMs.

Converted fc_exch_alloc to inline being now tiny a function
and already not an exported libfc API any more.
Signed-off-by: default avatarVasu Dev <vasu.dev@intel.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent a104c844
...@@ -734,19 +734,14 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport, ...@@ -734,19 +734,14 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport,
* EM is selected when a NULL match function pointer is encountered * EM is selected when a NULL match function pointer is encountered
* or when a call to a match function returns true. * or when a call to a match function returns true.
*/ */
static struct fc_exch *fc_exch_alloc(struct fc_lport *lport, static inline struct fc_exch *fc_exch_alloc(struct fc_lport *lport,
struct fc_frame *fp) struct fc_frame *fp)
{ {
struct fc_exch_mgr_anchor *ema; struct fc_exch_mgr_anchor *ema;
struct fc_exch *ep;
list_for_each_entry(ema, &lport->ema_list, ema_list) { list_for_each_entry(ema, &lport->ema_list, ema_list)
if (!ema->match || ema->match(fp)) { if (!ema->match || ema->match(fp))
ep = fc_exch_em_alloc(lport, ema->mp); return fc_exch_em_alloc(lport, ema->mp);
if (ep)
return ep;
}
}
return NULL; return NULL;
} }
......
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