aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMatthew Dobson <colpatch@us.ibm.com>2006-03-26 04:37:50 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 11:57:00 -0500
commit93d2341c750cda0df48a6cc67b35fe25f1ec47df (patch)
treef098a3bbfae65ce967591ee94d605c6e6bea21c6 /fs
parentfec433aaaae32a02329ad7d71b0f3c91b7525077 (diff)
[PATCH] mempool: use mempool_create_slab_pool()
Modify well over a dozen mempool users to call mempool_create_slab_pool() rather than calling mempool_create() with extra arguments, saving about 30 lines of code and increasing readability. 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 'fs')
-rw-r--r--fs/bio.c7
-rw-r--r--fs/cifs/cifsfs.c18
-rw-r--r--fs/jfs/jfs_metapage.c4
-rw-r--r--fs/nfs/read.c6
-rw-r--r--fs/nfs/write.c12
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c5
6 files changed, 18 insertions, 34 deletions
diff --git a/fs/bio.c b/fs/bio.c
index 377046d82945..eb8fbc53f2cd 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1141,8 +1141,7 @@ static int biovec_create_pools(struct bio_set *bs, int pool_entries, int scale)
1141 if (i >= scale) 1141 if (i >= scale)
1142 pool_entries >>= 1; 1142 pool_entries >>= 1;
1143 1143
1144 *bvp = mempool_create(pool_entries, mempool_alloc_slab, 1144 *bvp = mempool_create_slab_pool(pool_entries, bp->slab);
1145 mempool_free_slab, bp->slab);
1146 if (!*bvp) 1145 if (!*bvp)
1147 return -ENOMEM; 1146 return -ENOMEM;
1148 } 1147 }
@@ -1179,9 +1178,7 @@ struct bio_set *bioset_create(int bio_pool_size, int bvec_pool_size, int scale)
1179 if (!bs) 1178 if (!bs)
1180 return NULL; 1179 return NULL;
1181 1180
1182 bs->bio_pool = mempool_create(bio_pool_size, mempool_alloc_slab, 1181 bs->bio_pool = mempool_create_slab_pool(bio_pool_size, bio_slab);
1183 mempool_free_slab, bio_slab);
1184
1185 if (!bs->bio_pool) 1182 if (!bs->bio_pool)
1186 goto bad; 1183 goto bad;
1187 1184
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 221b3334b737..6b99b51d6694 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -738,10 +738,8 @@ cifs_init_request_bufs(void)
738 cERROR(1,("cifs_min_rcv set to maximum (64)")); 738 cERROR(1,("cifs_min_rcv set to maximum (64)"));
739 } 739 }
740 740
741 cifs_req_poolp = mempool_create(cifs_min_rcv, 741 cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv,
742 mempool_alloc_slab, 742 cifs_req_cachep);
743 mempool_free_slab,
744 cifs_req_cachep);
745 743
746 if(cifs_req_poolp == NULL) { 744 if(cifs_req_poolp == NULL) {
747 kmem_cache_destroy(cifs_req_cachep); 745 kmem_cache_destroy(cifs_req_cachep);
@@ -771,10 +769,8 @@ cifs_init_request_bufs(void)
771 cFYI(1,("cifs_min_small set to maximum (256)")); 769 cFYI(1,("cifs_min_small set to maximum (256)"));
772 } 770 }
773 771
774 cifs_sm_req_poolp = mempool_create(cifs_min_small, 772 cifs_sm_req_poolp = mempool_create_slab_pool(cifs_min_small,
775 mempool_alloc_slab, 773 cifs_sm_req_cachep);
776 mempool_free_slab,
777 cifs_sm_req_cachep);
778 774
779 if(cifs_sm_req_poolp == NULL) { 775 if(cifs_sm_req_poolp == NULL) {
780 mempool_destroy(cifs_req_poolp); 776 mempool_destroy(cifs_req_poolp);
@@ -808,10 +804,8 @@ cifs_init_mids(void)
808 if (cifs_mid_cachep == NULL) 804 if (cifs_mid_cachep == NULL)
809 return -ENOMEM; 805 return -ENOMEM;
810 806
811 cifs_mid_poolp = mempool_create(3 /* a reasonable min simultan opers */, 807 /* 3 is a reasonable minimum number of simultaneous operations */
812 mempool_alloc_slab, 808 cifs_mid_poolp = mempool_create_slab_pool(3, cifs_mid_cachep);
813 mempool_free_slab,
814 cifs_mid_cachep);
815 if(cifs_mid_poolp == NULL) { 809 if(cifs_mid_poolp == NULL) {
816 kmem_cache_destroy(cifs_mid_cachep); 810 kmem_cache_destroy(cifs_mid_cachep);
817 return -ENOMEM; 811 return -ENOMEM;
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index 8508043849f3..f28696f235c4 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -220,8 +220,8 @@ int __init metapage_init(void)
220 if (metapage_cache == NULL) 220 if (metapage_cache == NULL)
221 return -ENOMEM; 221 return -ENOMEM;
222 222
223 metapage_mempool = mempool_create(METAPOOL_MIN_PAGES, mempool_alloc_slab, 223 metapage_mempool = mempool_create_slab_pool(METAPOOL_MIN_PAGES,
224 mempool_free_slab, metapage_cache); 224 metapage_cache);
225 225
226 if (metapage_mempool == NULL) { 226 if (metapage_mempool == NULL) {
227 kmem_cache_destroy(metapage_cache); 227 kmem_cache_destroy(metapage_cache);
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 3961524fd4ab..624ca7146b6b 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -663,10 +663,8 @@ int nfs_init_readpagecache(void)
663 if (nfs_rdata_cachep == NULL) 663 if (nfs_rdata_cachep == NULL)
664 return -ENOMEM; 664 return -ENOMEM;
665 665
666 nfs_rdata_mempool = mempool_create(MIN_POOL_READ, 666 nfs_rdata_mempool = mempool_create_slab_pool(MIN_POOL_READ,
667 mempool_alloc_slab, 667 nfs_rdata_cachep);
668 mempool_free_slab,
669 nfs_rdata_cachep);
670 if (nfs_rdata_mempool == NULL) 668 if (nfs_rdata_mempool == NULL)
671 return -ENOMEM; 669 return -ENOMEM;
672 670
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 3f5225404c97..4cfada2cc09f 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1521,17 +1521,13 @@ int nfs_init_writepagecache(void)
1521 if (nfs_wdata_cachep == NULL) 1521 if (nfs_wdata_cachep == NULL)
1522 return -ENOMEM; 1522 return -ENOMEM;
1523 1523
1524 nfs_wdata_mempool = mempool_create(MIN_POOL_WRITE, 1524 nfs_wdata_mempool = mempool_create_slab_pool(MIN_POOL_WRITE,
1525 mempool_alloc_slab, 1525 nfs_wdata_cachep);
1526 mempool_free_slab,
1527 nfs_wdata_cachep);
1528 if (nfs_wdata_mempool == NULL) 1526 if (nfs_wdata_mempool == NULL)
1529 return -ENOMEM; 1527 return -ENOMEM;
1530 1528
1531 nfs_commit_mempool = mempool_create(MIN_POOL_COMMIT, 1529 nfs_commit_mempool = mempool_create_slab_pool(MIN_POOL_COMMIT,
1532 mempool_alloc_slab, 1530 nfs_wdata_cachep);
1533 mempool_free_slab,
1534 nfs_wdata_cachep);
1535 if (nfs_commit_mempool == NULL) 1531 if (nfs_commit_mempool == NULL)
1536 return -ENOMEM; 1532 return -ENOMEM;
1537 1533
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 8355faf8ffde..1884300417e3 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -375,9 +375,8 @@ xfs_init_zones(void)
375 if (!xfs_ioend_zone) 375 if (!xfs_ioend_zone)
376 goto out_destroy_vnode_zone; 376 goto out_destroy_vnode_zone;
377 377
378 xfs_ioend_pool = mempool_create(4 * MAX_BUF_PER_PAGE, 378 xfs_ioend_pool = mempool_create_slab_pool(4 * MAX_BUF_PER_PAGE,
379 mempool_alloc_slab, mempool_free_slab, 379 xfs_ioend_zone);
380 xfs_ioend_zone);
381 if (!xfs_ioend_pool) 380 if (!xfs_ioend_pool)
382 goto out_free_ioend_zone; 381 goto out_free_ioend_zone;
383 return 0; 382 return 0;