From 7359a19cc758946aba0e45233b8641256b194884 Mon Sep 17 00:00:00 2001 From: Steven Whitehouse Date: Mon, 13 Feb 2006 12:27:43 +0000 Subject: [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 --- fs/gfs2/inode.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'fs/gfs2/inode.h') diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h index 214975c6bb2..8ef85f5feb1 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; } -- cgit v1.2.3