summaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorMatthew Dobson <colpatch@us.ibm.com>2006-03-26 01:37:47 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 08:56:59 -0800
commit0eaae62abaa1ad1f231932b6cdd9fb1b91df6651 (patch)
treecda02cffff075a8b542ddcea4fa0ff0064130502 /drivers/s390
parent53184082b070dfb077218828fdf839826102ed96 (diff)
downloadtalos-op-linux-0eaae62abaa1ad1f231932b6cdd9fb1b91df6651.tar.gz
talos-op-linux-0eaae62abaa1ad1f231932b6cdd9fb1b91df6651.zip
[PATCH] mempool: use common mempool kmalloc allocator
This patch changes several mempool users, all of which are basically just wrappers around kmalloc(), to use the common mempool_kmalloc/kfree, rather than their own wrapper function, removing a bunch of duplicated code. Signed-off-by: Matthew Dobson <colpatch@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c60
1 files changed, 18 insertions, 42 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 95b92f317b6f..395cfc6a344f 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -829,18 +829,6 @@ zfcp_unit_dequeue(struct zfcp_unit *unit)
device_unregister(&unit->sysfs_device);
}
-static void *
-zfcp_mempool_alloc(gfp_t gfp_mask, void *size)
-{
- return kmalloc((size_t) size, gfp_mask);
-}
-
-static void
-zfcp_mempool_free(void *element, void *size)
-{
- kfree(element);
-}
-
/*
* Allocates a combined QTCB/fsf_req buffer for erp actions and fcp/SCSI
* commands.
@@ -853,51 +841,39 @@ static int
zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter)
{
adapter->pool.fsf_req_erp =
- mempool_create(ZFCP_POOL_FSF_REQ_ERP_NR,
- zfcp_mempool_alloc, zfcp_mempool_free, (void *)
- sizeof(struct zfcp_fsf_req_pool_element));
-
- if (NULL == adapter->pool.fsf_req_erp)
+ mempool_create_kmalloc_pool(ZFCP_POOL_FSF_REQ_ERP_NR,
+ sizeof(struct zfcp_fsf_req_pool_element));
+ if (!adapter->pool.fsf_req_erp)
return -ENOMEM;
adapter->pool.fsf_req_scsi =
- mempool_create(ZFCP_POOL_FSF_REQ_SCSI_NR,
- zfcp_mempool_alloc, zfcp_mempool_free, (void *)
- sizeof(struct zfcp_fsf_req_pool_element));
-
- if (NULL == adapter->pool.fsf_req_scsi)
+ mempool_create_kmalloc_pool(ZFCP_POOL_FSF_REQ_SCSI_NR,
+ sizeof(struct zfcp_fsf_req_pool_element));
+ if (!adapter->pool.fsf_req_scsi)
return -ENOMEM;
adapter->pool.fsf_req_abort =
- mempool_create(ZFCP_POOL_FSF_REQ_ABORT_NR,
- zfcp_mempool_alloc, zfcp_mempool_free, (void *)
- sizeof(struct zfcp_fsf_req_pool_element));
-
- if (NULL == adapter->pool.fsf_req_abort)
+ mempool_create_kmalloc_pool(ZFCP_POOL_FSF_REQ_ABORT_NR,
+ sizeof(struct zfcp_fsf_req_pool_element));
+ if (!adapter->pool.fsf_req_abort)
return -ENOMEM;
adapter->pool.fsf_req_status_read =
- mempool_create(ZFCP_POOL_STATUS_READ_NR,
- zfcp_mempool_alloc, zfcp_mempool_free,
- (void *) sizeof(struct zfcp_fsf_req));
-
- if (NULL == adapter->pool.fsf_req_status_read)
+ mempool_create_kmalloc_pool(ZFCP_POOL_STATUS_READ_NR,
+ sizeof(struct zfcp_fsf_req));
+ if (!adapter->pool.fsf_req_status_read)
return -ENOMEM;
adapter->pool.data_status_read =
- mempool_create(ZFCP_POOL_STATUS_READ_NR,
- zfcp_mempool_alloc, zfcp_mempool_free,
- (void *) sizeof(struct fsf_status_read_buffer));
-
- if (NULL == adapter->pool.data_status_read)
+ mempool_create_kmalloc_pool(ZFCP_POOL_STATUS_READ_NR,
+ sizeof(struct fsf_status_read_buffer));
+ if (!adapter->pool.data_status_read)
return -ENOMEM;
adapter->pool.data_gid_pn =
- mempool_create(ZFCP_POOL_DATA_GID_PN_NR,
- zfcp_mempool_alloc, zfcp_mempool_free, (void *)
- sizeof(struct zfcp_gid_pn_data));
-
- if (NULL == adapter->pool.data_gid_pn)
+ mempool_create_kmalloc_pool(ZFCP_POOL_DATA_GID_PN_NR,
+ sizeof(struct zfcp_gid_pn_data));
+ if (!adapter->pool.data_gid_pn)
return -ENOMEM;
return 0;
OpenPOWER on IntegriCloud