aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-10-27 21:30:09 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-10-27 21:30:09 -0400
commit16828088f9e518158edecb6cde7e6fa38e4c889b (patch)
tree620f14e52107d59aee3a0c55135037df4a07ae73
parent7845c0497536c566bfef08db1a38ae1ad2c25464 (diff)
ext4: use KMEM_CACHE instead of kmem_cache_create
Also remove the SLAB_RECLAIM_ACCOUNT flag from the system zone kmem cache. This slab tends to be fairly static, so it shouldn't be marked as likely to have free pages that can be reclaimed. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--fs/ext4/block_validity.c3
-rw-r--r--fs/ext4/mballoc.c18
2 files changed, 7 insertions, 14 deletions
diff --git a/fs/ext4/block_validity.c b/fs/ext4/block_validity.c
index 3db5084db9bd..68bab70dd139 100644
--- a/fs/ext4/block_validity.c
+++ b/fs/ext4/block_validity.c
@@ -31,8 +31,7 @@ static struct kmem_cache *ext4_system_zone_cachep;
31 31
32int __init init_ext4_system_zone(void) 32int __init init_ext4_system_zone(void)
33{ 33{
34 ext4_system_zone_cachep = KMEM_CACHE(ext4_system_zone, 34 ext4_system_zone_cachep = KMEM_CACHE(ext4_system_zone, 0);
35 SLAB_RECLAIM_ACCOUNT);
36 if (ext4_system_zone_cachep == NULL) 35 if (ext4_system_zone_cachep == NULL)
37 return -ENOMEM; 36 return -ENOMEM;
38 return 0; 37 return 0;
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 3f62df50f483..d732ef5a835d 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2706,26 +2706,20 @@ static void ext4_remove_debugfs_entry(void)
2706 2706
2707int __init init_ext4_mballoc(void) 2707int __init init_ext4_mballoc(void)
2708{ 2708{
2709 ext4_pspace_cachep = 2709 ext4_pspace_cachep = KMEM_CACHE(ext4_prealloc_space,
2710 kmem_cache_create("ext4_prealloc_space", 2710 SLAB_RECLAIM_ACCOUNT);
2711 sizeof(struct ext4_prealloc_space),
2712 0, SLAB_RECLAIM_ACCOUNT, NULL);
2713 if (ext4_pspace_cachep == NULL) 2711 if (ext4_pspace_cachep == NULL)
2714 return -ENOMEM; 2712 return -ENOMEM;
2715 2713
2716 ext4_ac_cachep = 2714 ext4_ac_cachep = KMEM_CACHE(ext4_allocation_context,
2717 kmem_cache_create("ext4_alloc_context", 2715 SLAB_RECLAIM_ACCOUNT);
2718 sizeof(struct ext4_allocation_context),
2719 0, SLAB_RECLAIM_ACCOUNT, NULL);
2720 if (ext4_ac_cachep == NULL) { 2716 if (ext4_ac_cachep == NULL) {
2721 kmem_cache_destroy(ext4_pspace_cachep); 2717 kmem_cache_destroy(ext4_pspace_cachep);
2722 return -ENOMEM; 2718 return -ENOMEM;
2723 } 2719 }
2724 2720
2725 ext4_free_ext_cachep = 2721 ext4_free_ext_cachep = KMEM_CACHE(ext4_free_data,
2726 kmem_cache_create("ext4_free_block_extents", 2722 SLAB_RECLAIM_ACCOUNT);
2727 sizeof(struct ext4_free_data),
2728 0, SLAB_RECLAIM_ACCOUNT, NULL);
2729 if (ext4_free_ext_cachep == NULL) { 2723 if (ext4_free_ext_cachep == NULL) {
2730 kmem_cache_destroy(ext4_pspace_cachep); 2724 kmem_cache_destroy(ext4_pspace_cachep);
2731 kmem_cache_destroy(ext4_ac_cachep); 2725 kmem_cache_destroy(ext4_ac_cachep);