Skip to content

Commit 41ced6d

Browse files
author
Al Viro
committed
switch gfs2, close races
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 1c929cf commit 41ced6d

3 files changed

Lines changed: 3 additions & 14 deletions

File tree

‎fs/gfs2/export.c‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,20 +126,14 @@ static int gfs2_get_name(struct dentry *parent, char *name,
126126

127127
static struct dentry *gfs2_get_parent(struct dentry *child)
128128
{
129-
struct dentry *dentry;
130-
131-
dentry = d_obtain_alias(gfs2_lookupi(child->d_inode, &gfs2_qdotdot, 1));
132-
if (!IS_ERR(dentry))
133-
d_set_d_op(dentry, &gfs2_dops);
134-
return dentry;
129+
return d_obtain_alias(gfs2_lookupi(child->d_inode, &gfs2_qdotdot, 1));
135130
}
136131

137132
static struct dentry *gfs2_get_dentry(struct super_block *sb,
138133
struct gfs2_inum_host *inum)
139134
{
140135
struct gfs2_sbd *sdp = sb->s_fs_info;
141136
struct inode *inode;
142-
struct dentry *dentry;
143137

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

158152
out_inode:
159-
dentry = d_obtain_alias(inode);
160-
if (!IS_ERR(dentry))
161-
d_set_d_op(dentry, &gfs2_dops);
162-
return dentry;
153+
return d_obtain_alias(inode);
163154
}
164155

165156
static struct dentry *gfs2_fh_to_dentry(struct super_block *sb, struct fid *fid,

‎fs/gfs2/ops_fstype.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,6 @@ static int gfs2_lookup_root(struct super_block *sb, struct dentry **dptr,
440440
iput(inode);
441441
return -ENOMEM;
442442
}
443-
d_set_d_op(dentry, &gfs2_dops);
444443
*dptr = dentry;
445444
return 0;
446445
}
@@ -1106,6 +1105,7 @@ static int fill_super(struct super_block *sb, struct gfs2_args *args, int silent
11061105

11071106
sb->s_magic = GFS2_MAGIC;
11081107
sb->s_op = &gfs2_super_ops;
1108+
sb->s_d_op = &gfs2_dops;
11091109
sb->s_export_op = &gfs2_export_ops;
11101110
sb->s_xattr = gfs2_xattr_handlers;
11111111
sb->s_qcop = &gfs2_quotactl_ops;

‎fs/gfs2/ops_inode.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ static struct dentry *gfs2_lookup(struct inode *dir, struct dentry *dentry,
106106
{
107107
struct inode *inode = NULL;
108108

109-
d_set_d_op(dentry, &gfs2_dops);
110-
111109
inode = gfs2_lookupi(dir, &dentry->d_name, 0);
112110
if (inode && IS_ERR(inode))
113111
return ERR_CAST(inode);

0 commit comments

Comments
 (0)