diff options
Diffstat (limited to 'fs/gfs2/main.c')
-rw-r--r-- | fs/gfs2/main.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c index 9ce56b5c7803..b24d0b40d965 100644 --- a/fs/gfs2/main.c +++ b/fs/gfs2/main.c | |||
@@ -23,6 +23,20 @@ | |||
23 | #include "sys.h" | 23 | #include "sys.h" |
24 | #include "util.h" | 24 | #include "util.h" |
25 | 25 | ||
26 | static void gfs2_init_inode_once(void *foo, kmem_cache_t *cachep, unsigned long flags) | ||
27 | { | ||
28 | struct gfs2_inode *ip = foo; | ||
29 | if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == | ||
30 | SLAB_CTOR_CONSTRUCTOR) { | ||
31 | inode_init_once(&ip->i_inode); | ||
32 | atomic_set(&ip->i_count, 0); | ||
33 | ip->i_vnode = &ip->i_inode; | ||
34 | spin_lock_init(&ip->i_spin); | ||
35 | init_rwsem(&ip->i_rw_mutex); | ||
36 | memset(ip->i_cache, 0, sizeof(ip->i_cache)); | ||
37 | } | ||
38 | } | ||
39 | |||
26 | /** | 40 | /** |
27 | * init_gfs2_fs - Register GFS2 as a filesystem | 41 | * init_gfs2_fs - Register GFS2 as a filesystem |
28 | * | 42 | * |
@@ -49,7 +63,9 @@ static int __init init_gfs2_fs(void) | |||
49 | 63 | ||
50 | gfs2_inode_cachep = kmem_cache_create("gfs2_inode", | 64 | gfs2_inode_cachep = kmem_cache_create("gfs2_inode", |
51 | sizeof(struct gfs2_inode), | 65 | sizeof(struct gfs2_inode), |
52 | 0, 0, NULL, NULL); | 66 | 0, (SLAB_RECLAIM_ACCOUNT| |
67 | SLAB_PANIC|SLAB_MEM_SPREAD), | ||
68 | gfs2_init_inode_once, NULL); | ||
53 | if (!gfs2_inode_cachep) | 69 | if (!gfs2_inode_cachep) |
54 | goto fail; | 70 | goto fail; |
55 | 71 | ||