Skip to content

Commit

Permalink
switch gfs2, close races
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jan 13, 2011
1 parent 1c929cf commit 41ced6d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
13 changes: 2 additions & 11 deletions fs/gfs2/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,14 @@ static int gfs2_get_name(struct dentry *parent, char *name,

static struct dentry *gfs2_get_parent(struct dentry *child)
{
struct dentry *dentry;

dentry = d_obtain_alias(gfs2_lookupi(child->d_inode, &gfs2_qdotdot, 1));
if (!IS_ERR(dentry))
d_set_d_op(dentry, &gfs2_dops);
return dentry;
return d_obtain_alias(gfs2_lookupi(child->d_inode, &gfs2_qdotdot, 1));
}

static struct dentry *gfs2_get_dentry(struct super_block *sb,
struct gfs2_inum_host *inum)
{
struct gfs2_sbd *sdp = sb->s_fs_info;
struct inode *inode;
struct dentry *dentry;

inode = gfs2_ilookup(sb, inum->no_addr);
if (inode) {
Expand All @@ -156,10 +150,7 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb,
return ERR_CAST(inode);

out_inode:
dentry = d_obtain_alias(inode);
if (!IS_ERR(dentry))
d_set_d_op(dentry, &gfs2_dops);
return dentry;
return d_obtain_alias(inode);
}

static struct dentry *gfs2_fh_to_dentry(struct super_block *sb, struct fid *fid,
Expand Down
2 changes: 1 addition & 1 deletion fs/gfs2/ops_fstype.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ static int gfs2_lookup_root(struct super_block *sb, struct dentry **dptr,
iput(inode);
return -ENOMEM;
}
d_set_d_op(dentry, &gfs2_dops);
*dptr = dentry;
return 0;
}
Expand Down Expand Up @@ -1106,6 +1105,7 @@ static int fill_super(struct super_block *sb, struct gfs2_args *args, int silent

sb->s_magic = GFS2_MAGIC;
sb->s_op = &gfs2_super_ops;
sb->s_d_op = &gfs2_dops;
sb->s_export_op = &gfs2_export_ops;
sb->s_xattr = gfs2_xattr_handlers;
sb->s_qcop = &gfs2_quotactl_ops;
Expand Down
2 changes: 0 additions & 2 deletions fs/gfs2/ops_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ static struct dentry *gfs2_lookup(struct inode *dir, struct dentry *dentry,
{
struct inode *inode = NULL;

d_set_d_op(dentry, &gfs2_dops);

inode = gfs2_lookupi(dir, &dentry->d_name, 0);
if (inode && IS_ERR(inode))
return ERR_CAST(inode);
Expand Down

0 comments on commit 41ced6d

Please sign in to comment.