aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.h
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-02-13 07:27:43 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-02-13 07:27:43 -0500
commit7359a19cc758946aba0e45233b8641256b194884 (patch)
treed96aaeb2fb239efe6fdb0b4698eb94108719f423 /fs/gfs2/inode.h
parent18ec7d5c3f434aed9661ed10a9e1f48cdeb4981d (diff)
[GFS2] Fix for root inode ref count bug
Umount is now working correctly again. The bug was due to not getting an extra ref count when mounting the fs. We should have bumped it by two (once for the internal pointer to the root inode from the super block and once for the inode hanging off the dcache entry for root). Also this patch tidys up the code dealing with looking up and creating inodes. We now pass Linux inodes (with gfs2_inodes attached) rather than the other way around and this reduces code duplication in various places. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.h')
-rw-r--r--fs/gfs2/inode.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h
index 214975c6bb22..8ef85f5feb1b 100644
--- a/fs/gfs2/inode.h
+++ b/fs/gfs2/inode.h
@@ -44,9 +44,9 @@ void gfs2_inode_destroy(struct gfs2_inode *ip);
44int gfs2_inode_dealloc(struct gfs2_sbd *sdp, struct gfs2_unlinked *ul); 44int gfs2_inode_dealloc(struct gfs2_sbd *sdp, struct gfs2_unlinked *ul);
45 45
46int gfs2_change_nlink(struct gfs2_inode *ip, int diff); 46int gfs2_change_nlink(struct gfs2_inode *ip, int diff);
47int gfs2_lookupi(struct gfs2_inode *dip, struct qstr *name, int is_root, 47int gfs2_lookupi(struct inode *dir, struct qstr *name, int is_root,
48 struct gfs2_inode **ipp); 48 struct inode **ipp);
49int gfs2_createi(struct gfs2_holder *ghs, struct qstr *name, unsigned int mode); 49struct inode *gfs2_createi(struct gfs2_holder *ghs, struct qstr *name, unsigned int mode);
50int gfs2_unlinki(struct gfs2_inode *dip, struct qstr *name, 50int gfs2_unlinki(struct gfs2_inode *dip, struct qstr *name,
51 struct gfs2_inode *ip, struct gfs2_unlinked *ul); 51 struct gfs2_inode *ip, struct gfs2_unlinked *ul);
52int gfs2_rmdiri(struct gfs2_inode *dip, struct qstr *name, 52int gfs2_rmdiri(struct gfs2_inode *dip, struct qstr *name,
@@ -68,19 +68,12 @@ int gfs2_repermission(struct inode *inode, int mask, struct nameidata *nd);
68static inline int gfs2_lookup_simple(struct inode *dip, char *name, 68static inline int gfs2_lookup_simple(struct inode *dip, char *name,
69 struct inode **ipp) 69 struct inode **ipp)
70{ 70{
71 struct gfs2_inode *ip;
72 struct qstr qstr; 71 struct qstr qstr;
73 int err; 72 int err;
74 memset(&qstr, 0, sizeof(struct qstr)); 73 memset(&qstr, 0, sizeof(struct qstr));
75 qstr.name = name; 74 qstr.name = name;
76 qstr.len = strlen(name); 75 qstr.len = strlen(name);
77 err = gfs2_lookupi(get_v2ip(dip), &qstr, 1, &ip); 76 err = gfs2_lookupi(dip, &qstr, 1, ipp);
78 if (err == 0) {
79 *ipp = gfs2_ip2v(ip);
80 gfs2_inode_put(ip);
81 if (*ipp == NULL)
82 err = -ENOMEM;
83 }
84 return err; 77 return err;
85} 78}
86 79