diff options
author | Bob Peterson <rpeterso@redhat.com> | 2008-01-28 18:20:26 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-03-31 05:40:07 -0400 |
commit | 6bdd9be628fa5f4dd14eb89ebddc12840d684277 (patch) | |
tree | 7a995fa251a55af6f7b185810a24a7ebb5d00a33 /fs/gfs2/main.c | |
parent | 3ad62e87cd38817361e165cf4ad496ab76e19e81 (diff) |
[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.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c index 9c7765c12d62..053e2ebbbd50 100644 --- a/fs/gfs2/main.c +++ b/fs/gfs2/main.c | |||
@@ -89,6 +89,12 @@ static int __init init_gfs2_fs(void) | |||
89 | if (!gfs2_bufdata_cachep) | 89 | if (!gfs2_bufdata_cachep) |
90 | goto fail; | 90 | goto fail; |
91 | 91 | ||
92 | gfs2_rgrpd_cachep = kmem_cache_create("gfs2_rgrpd", | ||
93 | sizeof(struct gfs2_rgrpd), | ||
94 | 0, 0, NULL); | ||
95 | if (!gfs2_rgrpd_cachep) | ||
96 | goto fail; | ||
97 | |||
92 | error = register_filesystem(&gfs2_fs_type); | 98 | error = register_filesystem(&gfs2_fs_type); |
93 | if (error) | 99 | if (error) |
94 | goto fail; | 100 | goto fail; |
@@ -108,6 +114,9 @@ fail_unregister: | |||
108 | fail: | 114 | fail: |
109 | gfs2_glock_exit(); | 115 | gfs2_glock_exit(); |
110 | 116 | ||
117 | if (gfs2_rgrpd_cachep) | ||
118 | kmem_cache_destroy(gfs2_rgrpd_cachep); | ||
119 | |||
111 | if (gfs2_bufdata_cachep) | 120 | if (gfs2_bufdata_cachep) |
112 | kmem_cache_destroy(gfs2_bufdata_cachep); | 121 | kmem_cache_destroy(gfs2_bufdata_cachep); |
113 | 122 | ||
@@ -133,6 +142,7 @@ static void __exit exit_gfs2_fs(void) | |||
133 | unregister_filesystem(&gfs2_fs_type); | 142 | unregister_filesystem(&gfs2_fs_type); |
134 | unregister_filesystem(&gfs2meta_fs_type); | 143 | unregister_filesystem(&gfs2meta_fs_type); |
135 | 144 | ||
145 | kmem_cache_destroy(gfs2_rgrpd_cachep); | ||
136 | kmem_cache_destroy(gfs2_bufdata_cachep); | 146 | kmem_cache_destroy(gfs2_bufdata_cachep); |
137 | kmem_cache_destroy(gfs2_inode_cachep); | 147 | kmem_cache_destroy(gfs2_inode_cachep); |
138 | kmem_cache_destroy(gfs2_glock_cachep); | 148 | kmem_cache_destroy(gfs2_glock_cachep); |