diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-05-18 16:25:27 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-05-18 16:25:27 -0400 |
commit | 320dd101e2d595a03439adb92b319f3af53dd1d0 (patch) | |
tree | 56a88401a218622018030045fec009bafdc4ce76 /fs/gfs2/main.c | |
parent | 3a8a9a1034813aa99f5ae3150f652d490c5ff10d (diff) |
[GFS2] glock debugging and inode cache changes
This adds some extra debugging to glock.c and changes
inode.c's deallocation code to call the debugging code
at a suitable moment. I'm chasing down a particular bug
to do with deallocation at the moment and the code can
go again once the bug is fixed.
Also this includes the first part of some changes to unify
the Linux struct inode and GFS2's struct gfs2_inode. This
transformation will happen in small parts over the next short
period.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
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 | ||