aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/main.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2008-01-28 17:20:26 -0600
committerSteven Whitehouse <swhiteho@redhat.com>2008-03-31 10:40:07 +0100
commit6bdd9be628fa5f4dd14eb89ebddc12840d684277 (patch)
tree7a995fa251a55af6f7b185810a24a7ebb5d00a33 /fs/gfs2/main.c
parent3ad62e87cd38817361e165cf4ad496ab76e19e81 (diff)
downloadkernel_samsung_smdk4412-6bdd9be628fa5f4dd14eb89ebddc12840d684277.zip
kernel_samsung_smdk4412-6bdd9be628fa5f4dd14eb89ebddc12840d684277.tar.gz
kernel_samsung_smdk4412-6bdd9be628fa5f4dd14eb89ebddc12840d684277.tar.bz2
[GFS2] Allocate gfs2_rgrpd from slab memory
This patch moves the gfs2_rgrpd structure to its own slab memory. This makes it easier to control and monitor, and yields less memory fragmentation. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/main.c')
-rw-r--r--fs/gfs2/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index 9c7765c..053e2eb 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -89,6 +89,12 @@ static int __init init_gfs2_fs(void)
if (!gfs2_bufdata_cachep)
goto fail;
+ gfs2_rgrpd_cachep = kmem_cache_create("gfs2_rgrpd",
+ sizeof(struct gfs2_rgrpd),
+ 0, 0, NULL);
+ if (!gfs2_rgrpd_cachep)
+ goto fail;
+
error = register_filesystem(&gfs2_fs_type);
if (error)
goto fail;
@@ -108,6 +114,9 @@ fail_unregister:
fail:
gfs2_glock_exit();
+ if (gfs2_rgrpd_cachep)
+ kmem_cache_destroy(gfs2_rgrpd_cachep);
+
if (gfs2_bufdata_cachep)
kmem_cache_destroy(gfs2_bufdata_cachep);
@@ -133,6 +142,7 @@ static void __exit exit_gfs2_fs(void)
unregister_filesystem(&gfs2_fs_type);
unregister_filesystem(&gfs2meta_fs_type);
+ kmem_cache_destroy(gfs2_rgrpd_cachep);
kmem_cache_destroy(gfs2_bufdata_cachep);
kmem_cache_destroy(gfs2_inode_cachep);
kmem_cache_destroy(gfs2_glock_cachep);