diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-13 12:27:43 +0000 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-13 12:27:43 +0000 |
commit | 7359a19cc758946aba0e45233b8641256b194884 (patch) | |
tree | d96aaeb2fb239efe6fdb0b4698eb94108719f423 /fs/gfs2/inode.h | |
parent | 18ec7d5c3f434aed9661ed10a9e1f48cdeb4981d (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.h | 15 |
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); int gfs2_inode_dealloc(struct gfs2_sbd *sdp, struct gfs2_unlinked *ul); int gfs2_change_nlink(struct gfs2_inode *ip, int diff); -int gfs2_lookupi(struct gfs2_inode *dip, struct qstr *name, int is_root, - struct gfs2_inode **ipp); -int gfs2_createi(struct gfs2_holder *ghs, struct qstr *name, unsigned int mode); +int gfs2_lookupi(struct inode *dir, struct qstr *name, int is_root, + struct inode **ipp); +struct inode *gfs2_createi(struct gfs2_holder *ghs, struct qstr *name, unsigned int mode); int gfs2_unlinki(struct gfs2_inode *dip, struct qstr *name, struct gfs2_inode *ip, struct gfs2_unlinked *ul); int gfs2_rmdiri(struct gfs2_inode *dip, struct qstr *name, @@ -68,19 +68,12 @@ int gfs2_repermission(struct inode *inode, int mask, struct nameidata *nd); static inline int gfs2_lookup_simple(struct inode *dip, char *name, struct inode **ipp) { - struct gfs2_inode *ip; struct qstr qstr; int err; memset(&qstr, 0, sizeof(struct qstr)); qstr.name = name; qstr.len = strlen(name); - err = gfs2_lookupi(get_v2ip(dip), &qstr, 1, &ip); - if (err == 0) { - *ipp = gfs2_ip2v(ip); - gfs2_inode_put(ip); - if (*ipp == NULL) - err = -ENOMEM; - } + err = gfs2_lookupi(dip, &qstr, 1, ipp); return err; } |