aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-09-12 18:21:05 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-10-09 02:39:15 -0400
commit4d93bc3e81736ce55c79d9cae743bab4f89b4f9c (patch)
tree8cabe67f17051e2f837bf3a8839afde800a7c3de /fs/gfs2/inode.c
parent18c85d09dcd14342cd4891d016f4086095160573 (diff)
gfs2_atomic_open(): skip lookups on hashed dentry
hashed dentry can be passed to ->atomic_open() only if a) it has just passed revalidation and b) it's negative Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index fc8ac2ee0667..8108b4f0354c 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1244,6 +1244,9 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,
1244 struct dentry *d; 1244 struct dentry *d;
1245 bool excl = !!(flags & O_EXCL); 1245 bool excl = !!(flags & O_EXCL);
1246 1246
1247 if (!d_unhashed(dentry))
1248 goto skip_lookup;
1249
1247 d = __gfs2_lookup(dir, dentry, file, opened); 1250 d = __gfs2_lookup(dir, dentry, file, opened);
1248 if (IS_ERR(d)) 1251 if (IS_ERR(d))
1249 return PTR_ERR(d); 1252 return PTR_ERR(d);
@@ -1260,6 +1263,8 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,
1260 } 1263 }
1261 1264
1262 BUG_ON(d != NULL); 1265 BUG_ON(d != NULL);
1266
1267skip_lookup:
1263 if (!(flags & O_CREAT)) 1268 if (!(flags & O_CREAT))
1264 return -ENOENT; 1269 return -ENOENT;
1265 1270