aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorVasu Dev <vasu.dev@intel.com>2009-10-21 19:27:28 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:00:29 -0500
commit89f19a59de0ec4626c64d90d2f5e255961cab879 (patch)
tree5680542ff703c38e2ff03ca983520427a18537be /drivers/scsi
parent22655ac22289d7b7def8ef2d72eafe5024bd57fe (diff)
[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: Alex Lyakas <alexl@mellanox.co.il> 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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libfc/fc_exch.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index ae8f9e9ac958..bdae9a9e7ae9 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -2046,6 +2046,20 @@ int fc_exch_init(struct fc_lport *lp)
2046 if (!lp->tt.seq_exch_abort) 2046 if (!lp->tt.seq_exch_abort)
2047 lp->tt.seq_exch_abort = fc_seq_exch_abort; 2047 lp->tt.seq_exch_abort = fc_seq_exch_abort;
2048 2048
2049 return 0;
2050}
2051EXPORT_SYMBOL(fc_exch_init);
2052
2053/**
2054 * fc_setup_exch_mgr() - Setup an exchange manager
2055 */
2056int fc_setup_exch_mgr()
2057{
2058 fc_em_cachep = kmem_cache_create("libfc_em", sizeof(struct fc_exch),
2059 0, SLAB_HWCACHE_ALIGN, NULL);
2060 if (!fc_em_cachep)
2061 return -ENOMEM;
2062
2049 /* 2063 /*
2050 * Initialize fc_cpu_mask and fc_cpu_order. The 2064 * Initialize fc_cpu_mask and fc_cpu_order. The
2051 * fc_cpu_mask is set for nr_cpu_ids rounded up 2065 * fc_cpu_mask is set for nr_cpu_ids rounded up
@@ -2070,16 +2084,6 @@ int fc_exch_init(struct fc_lport *lp)
2070 2084
2071 return 0; 2085 return 0;
2072} 2086}
2073EXPORT_SYMBOL(fc_exch_init);
2074
2075int fc_setup_exch_mgr(void)
2076{
2077 fc_em_cachep = kmem_cache_create("libfc_em", sizeof(struct fc_exch),
2078 0, SLAB_HWCACHE_ALIGN, NULL);
2079 if (!fc_em_cachep)
2080 return -ENOMEM;
2081 return 0;
2082}
2083 2087
2084void fc_destroy_exch_mgr(void) 2088void fc_destroy_exch_mgr(void)
2085{ 2089{