aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/main.c')
-rw-r--r--fs/gfs2/main.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index 754426b1e52c..6cdb0f2a1b09 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -70,16 +70,6 @@ static void gfs2_init_gl_aspace_once(void *foo)
70 address_space_init_once(mapping); 70 address_space_init_once(mapping);
71} 71}
72 72
73static void *gfs2_bh_alloc(gfp_t mask, void *data)
74{
75 return alloc_buffer_head(mask);
76}
77
78static void gfs2_bh_free(void *ptr, void *data)
79{
80 return free_buffer_head(ptr);
81}
82
83/** 73/**
84 * init_gfs2_fs - Register GFS2 as a filesystem 74 * init_gfs2_fs - Register GFS2 as a filesystem
85 * 75 *
@@ -143,6 +133,12 @@ static int __init init_gfs2_fs(void)
143 if (!gfs2_quotad_cachep) 133 if (!gfs2_quotad_cachep)
144 goto fail; 134 goto fail;
145 135
136 gfs2_rsrv_cachep = kmem_cache_create("gfs2_mblk",
137 sizeof(struct gfs2_blkreserv),
138 0, 0, NULL);
139 if (!gfs2_rsrv_cachep)
140 goto fail;
141
146 register_shrinker(&qd_shrinker); 142 register_shrinker(&qd_shrinker);
147 143
148 error = register_filesystem(&gfs2_fs_type); 144 error = register_filesystem(&gfs2_fs_type);
@@ -164,8 +160,8 @@ static int __init init_gfs2_fs(void)
164 if (!gfs2_control_wq) 160 if (!gfs2_control_wq)
165 goto fail_recovery; 161 goto fail_recovery;
166 162
167 gfs2_bh_pool = mempool_create(1024, gfs2_bh_alloc, gfs2_bh_free, NULL); 163 gfs2_page_pool = mempool_create_page_pool(64, 0);
168 if (!gfs2_bh_pool) 164 if (!gfs2_page_pool)
169 goto fail_control; 165 goto fail_control;
170 166
171 gfs2_register_debugfs(); 167 gfs2_register_debugfs();
@@ -186,6 +182,9 @@ fail:
186 unregister_shrinker(&qd_shrinker); 182 unregister_shrinker(&qd_shrinker);
187 gfs2_glock_exit(); 183 gfs2_glock_exit();
188 184
185 if (gfs2_rsrv_cachep)
186 kmem_cache_destroy(gfs2_rsrv_cachep);
187
189 if (gfs2_quotad_cachep) 188 if (gfs2_quotad_cachep)
190 kmem_cache_destroy(gfs2_quotad_cachep); 189 kmem_cache_destroy(gfs2_quotad_cachep);
191 190
@@ -225,7 +224,8 @@ static void __exit exit_gfs2_fs(void)
225 224
226 rcu_barrier(); 225 rcu_barrier();
227 226
228 mempool_destroy(gfs2_bh_pool); 227 mempool_destroy(gfs2_page_pool);
228 kmem_cache_destroy(gfs2_rsrv_cachep);
229 kmem_cache_destroy(gfs2_quotad_cachep); 229 kmem_cache_destroy(gfs2_quotad_cachep);
230 kmem_cache_destroy(gfs2_rgrpd_cachep); 230 kmem_cache_destroy(gfs2_rgrpd_cachep);
231 kmem_cache_destroy(gfs2_bufdata_cachep); 231 kmem_cache_destroy(gfs2_bufdata_cachep);