Commit 89f19a59 authored by Vasu Dev's avatar Vasu Dev Committed by James Bottomley

[SCSI] libfc: removes initializing fc_cpu_order and fc_cpu_mask per lport

Initializing these libfc globals per lport could mess up exch
allocation/free for existing lport.

So this patch moves their initialization to fc_setup_exch_mgr
so that these globals gets initialized only once for libfc.
Reported-by: default avatarAlex Lyakas <alexl@mellanox.co.il>
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 22655ac2
...@@ -2046,6 +2046,20 @@ int fc_exch_init(struct fc_lport *lp) ...@@ -2046,6 +2046,20 @@ int fc_exch_init(struct fc_lport *lp)
if (!lp->tt.seq_exch_abort) if (!lp->tt.seq_exch_abort)
lp->tt.seq_exch_abort = fc_seq_exch_abort; lp->tt.seq_exch_abort = fc_seq_exch_abort;
return 0;
}
EXPORT_SYMBOL(fc_exch_init);
/**
* fc_setup_exch_mgr() - Setup an exchange manager
*/
int fc_setup_exch_mgr()
{
fc_em_cachep = kmem_cache_create("libfc_em", sizeof(struct fc_exch),
0, SLAB_HWCACHE_ALIGN, NULL);
if (!fc_em_cachep)
return -ENOMEM;
/* /*
* Initialize fc_cpu_mask and fc_cpu_order. The * Initialize fc_cpu_mask and fc_cpu_order. The
* fc_cpu_mask is set for nr_cpu_ids rounded up * fc_cpu_mask is set for nr_cpu_ids rounded up
...@@ -2070,16 +2084,6 @@ int fc_exch_init(struct fc_lport *lp) ...@@ -2070,16 +2084,6 @@ int fc_exch_init(struct fc_lport *lp)
return 0; return 0;
} }
EXPORT_SYMBOL(fc_exch_init);
int fc_setup_exch_mgr(void)
{
fc_em_cachep = kmem_cache_create("libfc_em", sizeof(struct fc_exch),
0, SLAB_HWCACHE_ALIGN, NULL);
if (!fc_em_cachep)
return -ENOMEM;
return 0;
}
void fc_destroy_exch_mgr(void) void fc_destroy_exch_mgr(void)
{ {
......
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