From 9b053f3207e8887fed88162a339fdd4001abcdb2 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Thu, 13 Feb 2014 09:34:30 -0800 Subject: vfs: Remove unnecessary calls of check_submounts_and_drop Now that check_submounts_and_drop can not fail and is called from d_invalidate there is no longer a need to call check_submounts_and_drom from filesystem d_revalidate methods so remove it. Reviewed-by: Miklos Szeredi Signed-off-by: "Eric W. Biederman" Signed-off-by: Al Viro --- fs/gfs2/dentry.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'fs/gfs2') diff --git a/fs/gfs2/dentry.c b/fs/gfs2/dentry.c index d3a5d4e29ba5..589f4ea9381c 100644 --- a/fs/gfs2/dentry.c +++ b/fs/gfs2/dentry.c @@ -93,9 +93,6 @@ invalid_gunlock: if (!had_lock) gfs2_glock_dq_uninit(&d_gh); invalid: - if (check_submounts_and_drop(dentry) != 0) - goto valid; - dput(parent); return 0; -- cgit v1.2.3 From 4d93bc3e81736ce55c79d9cae743bab4f89b4f9c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 12 Sep 2014 18:21:05 -0400 Subject: 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 --- fs/gfs2/inode.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fs/gfs2') 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, struct dentry *d; bool excl = !!(flags & O_EXCL); + if (!d_unhashed(dentry)) + goto skip_lookup; + d = __gfs2_lookup(dir, dentry, file, opened); if (IS_ERR(d)) return PTR_ERR(d); @@ -1260,6 +1263,8 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry, } BUG_ON(d != NULL); + +skip_lookup: if (!(flags & O_CREAT)) return -ENOENT; -- cgit v1.2.3