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.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index c112943ee8c1..dccc4f6f503f 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -15,6 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/gfs2_ondisk.h> 17#include <linux/gfs2_ondisk.h>
18#include <asm/atomic.h>
18 19
19#include "gfs2.h" 20#include "gfs2.h"
20#include "lm_interface.h" 21#include "lm_interface.h"
@@ -35,6 +36,25 @@ static void gfs2_init_inode_once(void *foo, kmem_cache_t *cachep, unsigned long
35 } 36 }
36} 37}
37 38
39static void gfs2_init_glock_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
40{
41 struct gfs2_glock *gl = foo;
42 if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
43 SLAB_CTOR_CONSTRUCTOR) {
44 INIT_LIST_HEAD(&gl->gl_list);
45 spin_lock_init(&gl->gl_spin);
46 INIT_LIST_HEAD(&gl->gl_holders);
47 INIT_LIST_HEAD(&gl->gl_waiters1);
48 INIT_LIST_HEAD(&gl->gl_waiters2);
49 INIT_LIST_HEAD(&gl->gl_waiters3);
50 gl->gl_lvb = NULL;
51 atomic_set(&gl->gl_lvb_count, 0);
52 INIT_LIST_HEAD(&gl->gl_reclaim);
53 INIT_LIST_HEAD(&gl->gl_ail_list);
54 atomic_set(&gl->gl_ail_count, 0);
55 }
56}
57
38/** 58/**
39 * init_gfs2_fs - Register GFS2 as a filesystem 59 * init_gfs2_fs - Register GFS2 as a filesystem
40 * 60 *
@@ -55,7 +75,8 @@ static int __init init_gfs2_fs(void)
55 75
56 gfs2_glock_cachep = kmem_cache_create("gfs2_glock", 76 gfs2_glock_cachep = kmem_cache_create("gfs2_glock",
57 sizeof(struct gfs2_glock), 77 sizeof(struct gfs2_glock),
58 0, 0, NULL, NULL); 78 0, 0,
79 gfs2_init_glock_once, NULL);
59 if (!gfs2_glock_cachep) 80 if (!gfs2_glock_cachep)
60 goto fail; 81 goto fail;
61 82