[Cluster-devel] [PATCH 3/3] gfs2_atomic_open(): simplify the use of finish_no_open()

Al Viro viro at ZenIV.linux.org.uk
Wed Nov 19 19:35:58 UTC 2014


In ->atomic_open(inode, dentry, file, opened) calling finish_no_open(file, NULL)
is equivalent to dget(dentry); return finish_no_open(file, dentry);

No need to open-code that...

Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
---
 fs/gfs2/inode.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index ce0cf9a..6e29174 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1249,11 +1249,8 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,
 	if (d != NULL)
 		dentry = d;
 	if (dentry->d_inode) {
-		if (!(*opened & FILE_OPENED)) {
-			if (d == NULL)
-				dget(dentry);
-			return finish_no_open(file, dentry);
-		}
+		if (!(*opened & FILE_OPENED))
+			return finish_no_open(file, d);
 		dput(d);
 		return 0;
 	}
-- 
1.7.10.4




More information about the Cluster-devel mailing list