From: Al Viro Date: Wed, 19 Nov 2014 19:35:58 +0000 (+0000) Subject: GFS2: gfs2_atomic_open(): simplify the use of finish_no_open() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ec7d879c457611e540cb465c25f3040facbd1185;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git GFS2: 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 Signed-off-by: Steven Whitehouse --- diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 9e8545bbc55c..9054002ebe70 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -1245,11 +1245,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; }