Skip to content

Commit

Permalink
[SCSI] libfc: use offload EM instance again instead jumping to next EM
Browse files Browse the repository at this point in the history
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: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Vasu Dev authored and James Bottomley committed Apr 11, 2010
1 parent a104c84 commit 3e22760
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions drivers/scsi/libfc/fc_exch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* or when a call to a match function returns true.
*/
static struct fc_exch *fc_exch_alloc(struct fc_lport *lport,
struct fc_frame *fp)
static inline 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;
}
}
list_for_each_entry(ema, &lport->ema_list, ema_list)
if (!ema->match || ema->match(fp))
return fc_exch_em_alloc(lport, ema->mp);
return NULL;
}

Expand Down

0 comments on commit 3e22760

Please sign in to comment.