From: Al Viro Date: Wed, 19 Nov 2014 02:10:23 +0000 (-0500) Subject: gfs2_atomic_open(): simplify the use of finish_no_open() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=845409b49bcc8fe2ad9f1a948cc4f54c301b742d;p=deliverable%2Flinux.git gfs2_atomic_open(): simplify the use of finish_no_open() 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 --- diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index ce0cf9ad5f97..6e2917433170 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; }