Commit ec5ec66b authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Bob Peterson

gfs2: Get rid of gfs2_ilookup

Now that gfs2_lookup_by_inum only takes the inode glock for new inodes
(and not for cached inodes anymore), there no longer is a need to
optimize the cached-inode case in gfs2_get_dentry or delete_work_func,
and gfs2_ilookup can be removed.

In addition, gfs2_get_dentry wasn't checking the GFS2_DIF_SYSTEM flag in
i_diskflags in the gfs2_ilookup case (see gfs2_lookup_by_inum); this
inconsistency goes away as well.
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
parent 3ce37b2c
...@@ -137,21 +137,10 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, ...@@ -137,21 +137,10 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb,
struct gfs2_sbd *sdp = sb->s_fs_info; struct gfs2_sbd *sdp = sb->s_fs_info;
struct inode *inode; struct inode *inode;
inode = gfs2_ilookup(sb, inum->no_addr);
if (inode) {
if (GFS2_I(inode)->i_no_formal_ino != inum->no_formal_ino) {
iput(inode);
return ERR_PTR(-ESTALE);
}
goto out_inode;
}
inode = gfs2_lookup_by_inum(sdp, inum->no_addr, &inum->no_formal_ino, inode = gfs2_lookup_by_inum(sdp, inum->no_addr, &inum->no_formal_ino,
GFS2_BLKST_DINODE); GFS2_BLKST_DINODE);
if (IS_ERR(inode)) if (IS_ERR(inode))
return ERR_CAST(inode); return ERR_CAST(inode);
out_inode:
return d_obtain_alias(inode); return d_obtain_alias(inode);
} }
......
...@@ -575,8 +575,7 @@ static void delete_work_func(struct work_struct *work) ...@@ -575,8 +575,7 @@ static void delete_work_func(struct work_struct *work)
{ {
struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_delete); struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_delete);
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
struct gfs2_inode *ip; struct inode *inode;
struct inode *inode = NULL;
u64 no_addr = gl->gl_name.ln_number; u64 no_addr = gl->gl_name.ln_number;
/* If someone's using this glock to create a new dinode, the block must /* If someone's using this glock to create a new dinode, the block must
...@@ -585,13 +584,7 @@ static void delete_work_func(struct work_struct *work) ...@@ -585,13 +584,7 @@ static void delete_work_func(struct work_struct *work)
if (test_bit(GLF_INODE_CREATING, &gl->gl_flags)) if (test_bit(GLF_INODE_CREATING, &gl->gl_flags))
goto out; goto out;
ip = gl->gl_object; inode = gfs2_lookup_by_inum(sdp, no_addr, NULL, GFS2_BLKST_UNLINKED);
/* Note: Unsafe to dereference ip as we don't hold right refs/locks */
if (ip)
inode = gfs2_ilookup(sdp->sd_vfs, no_addr);
if (IS_ERR_OR_NULL(inode))
inode = gfs2_lookup_by_inum(sdp, no_addr, NULL, GFS2_BLKST_UNLINKED);
if (inode && !IS_ERR(inode)) { if (inode && !IS_ERR(inode)) {
d_prune_aliases(inode); d_prune_aliases(inode);
iput(inode); iput(inode);
......
...@@ -37,21 +37,6 @@ ...@@ -37,21 +37,6 @@
#include "super.h" #include "super.h"
#include "glops.h" #include "glops.h"
struct inode *gfs2_ilookup(struct super_block *sb, u64 no_addr)
{
struct inode *inode;
repeat:
inode = ilookup(sb, no_addr);
if (!inode)
return inode;
if (is_bad_inode(inode)) {
iput(inode);
goto repeat;
}
return inode;
}
static struct inode *gfs2_iget(struct super_block *sb, u64 no_addr) static struct inode *gfs2_iget(struct super_block *sb, u64 no_addr)
{ {
struct inode *inode; struct inode *inode;
......
...@@ -99,7 +99,6 @@ extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type, ...@@ -99,7 +99,6 @@ extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type,
extern struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr, extern struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr,
u64 *no_formal_ino, u64 *no_formal_ino,
unsigned int blktype); unsigned int blktype);
extern struct inode *gfs2_ilookup(struct super_block *sb, u64 no_addr);
extern int gfs2_inode_refresh(struct gfs2_inode *ip); extern int gfs2_inode_refresh(struct gfs2_inode *ip);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment