diff options
Diffstat (limited to 'drivers/scsi/fnic/fnic_main.c')
-rw-r--r-- | drivers/scsi/fnic/fnic_main.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index bb63f1a1f808..fc98eb61e760 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c | |||
@@ -388,17 +388,6 @@ static void fnic_iounmap(struct fnic *fnic) | |||
388 | iounmap(fnic->bar0.vaddr); | 388 | iounmap(fnic->bar0.vaddr); |
389 | } | 389 | } |
390 | 390 | ||
391 | /* | ||
392 | * Allocate element for mempools requiring GFP_DMA flag. | ||
393 | * Otherwise, checks in kmem_flagcheck() hit BUG_ON(). | ||
394 | */ | ||
395 | static void *fnic_alloc_slab_dma(gfp_t gfp_mask, void *pool_data) | ||
396 | { | ||
397 | struct kmem_cache *mem = pool_data; | ||
398 | |||
399 | return kmem_cache_alloc(mem, gfp_mask | GFP_ATOMIC | GFP_DMA); | ||
400 | } | ||
401 | |||
402 | /** | 391 | /** |
403 | * fnic_get_mac() - get assigned data MAC address for FIP code. | 392 | * fnic_get_mac() - get assigned data MAC address for FIP code. |
404 | * @lport: local port. | 393 | * @lport: local port. |
@@ -603,14 +592,12 @@ static int __devinit fnic_probe(struct pci_dev *pdev, | |||
603 | if (!fnic->io_req_pool) | 592 | if (!fnic->io_req_pool) |
604 | goto err_out_free_resources; | 593 | goto err_out_free_resources; |
605 | 594 | ||
606 | pool = mempool_create(2, fnic_alloc_slab_dma, mempool_free_slab, | 595 | pool = mempool_create_slab_pool(2, fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]); |
607 | fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]); | ||
608 | if (!pool) | 596 | if (!pool) |
609 | goto err_out_free_ioreq_pool; | 597 | goto err_out_free_ioreq_pool; |
610 | fnic->io_sgl_pool[FNIC_SGL_CACHE_DFLT] = pool; | 598 | fnic->io_sgl_pool[FNIC_SGL_CACHE_DFLT] = pool; |
611 | 599 | ||
612 | pool = mempool_create(2, fnic_alloc_slab_dma, mempool_free_slab, | 600 | pool = mempool_create_slab_pool(2, fnic_sgl_cache[FNIC_SGL_CACHE_MAX]); |
613 | fnic_sgl_cache[FNIC_SGL_CACHE_MAX]); | ||
614 | if (!pool) | 601 | if (!pool) |
615 | goto err_out_free_dflt_pool; | 602 | goto err_out_free_dflt_pool; |
616 | fnic->io_sgl_pool[FNIC_SGL_CACHE_MAX] = pool; | 603 | fnic->io_sgl_pool[FNIC_SGL_CACHE_MAX] = pool; |
@@ -876,7 +863,7 @@ static int __init fnic_init_module(void) | |||
876 | len = sizeof(struct fnic_dflt_sgl_list); | 863 | len = sizeof(struct fnic_dflt_sgl_list); |
877 | fnic_sgl_cache[FNIC_SGL_CACHE_DFLT] = kmem_cache_create | 864 | fnic_sgl_cache[FNIC_SGL_CACHE_DFLT] = kmem_cache_create |
878 | ("fnic_sgl_dflt", len + FNIC_SG_DESC_ALIGN, FNIC_SG_DESC_ALIGN, | 865 | ("fnic_sgl_dflt", len + FNIC_SG_DESC_ALIGN, FNIC_SG_DESC_ALIGN, |
879 | SLAB_HWCACHE_ALIGN | SLAB_CACHE_DMA, | 866 | SLAB_HWCACHE_ALIGN, |
880 | NULL); | 867 | NULL); |
881 | if (!fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]) { | 868 | if (!fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]) { |
882 | printk(KERN_ERR PFX "failed to create fnic dflt sgl slab\n"); | 869 | printk(KERN_ERR PFX "failed to create fnic dflt sgl slab\n"); |
@@ -888,7 +875,7 @@ static int __init fnic_init_module(void) | |||
888 | len = sizeof(struct fnic_sgl_list); | 875 | len = sizeof(struct fnic_sgl_list); |
889 | fnic_sgl_cache[FNIC_SGL_CACHE_MAX] = kmem_cache_create | 876 | fnic_sgl_cache[FNIC_SGL_CACHE_MAX] = kmem_cache_create |
890 | ("fnic_sgl_max", len + FNIC_SG_DESC_ALIGN, FNIC_SG_DESC_ALIGN, | 877 | ("fnic_sgl_max", len + FNIC_SG_DESC_ALIGN, FNIC_SG_DESC_ALIGN, |
891 | SLAB_HWCACHE_ALIGN | SLAB_CACHE_DMA, | 878 | SLAB_HWCACHE_ALIGN, |
892 | NULL); | 879 | NULL); |
893 | if (!fnic_sgl_cache[FNIC_SGL_CACHE_MAX]) { | 880 | if (!fnic_sgl_cache[FNIC_SGL_CACHE_MAX]) { |
894 | printk(KERN_ERR PFX "failed to create fnic max sgl slab\n"); | 881 | printk(KERN_ERR PFX "failed to create fnic max sgl slab\n"); |