[07/15] qnx4_lookup: use d_splice_alias()
diff mbox

Message ID 20180513213017.31269-7-viro@ZenIV.linux.org.uk
State New
Headers show

Commit Message

Al Viro May 13, 2018, 9:30 p.m. UTC
From: Al Viro <viro@zeniv.linux.org.uk>

Cc: Anders Larsen <al@alarsen.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/qnx4/namei.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Anders Larsen May 14, 2018, 10:48 a.m. UTC | #1
On Sunday, 13 May 2018 22:30 Al Viro wrote:
> From: Al Viro <viro@zeniv.linux.org.uk>
> 
> Cc: Anders Larsen <al@alarsen.net>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
>  fs/qnx4/namei.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)

Acked-by: Anders Larsen <al@alarsen.net>

> diff --git a/fs/qnx4/namei.c b/fs/qnx4/namei.c
> index eca27878079d..8d72221735d7 100644
> --- a/fs/qnx4/namei.c
> +++ b/fs/qnx4/namei.c
> @@ -114,13 +114,9 @@ struct dentry * qnx4_lookup(struct inode *dir, struct
> dentry *dentry, unsigned i brelse(bh);
> 
>  	foundinode = qnx4_iget(dir->i_sb, ino);
> -	if (IS_ERR(foundinode)) {
> +	if (IS_ERR(foundinode))
>  		QNX4DEBUG((KERN_ERR "qnx4: lookup->iget -> error %ld\n",
>  			   PTR_ERR(foundinode)));
> -		return ERR_CAST(foundinode);
> -	}
>  out:
> -	d_add(dentry, foundinode);
> -
> -	return NULL;
> +	return d_splice_alias(foundinode, dentry);
>  }

Patch
diff mbox

diff --git a/fs/qnx4/namei.c b/fs/qnx4/namei.c
index eca27878079d..8d72221735d7 100644
--- a/fs/qnx4/namei.c
+++ b/fs/qnx4/namei.c
@@ -114,13 +114,9 @@  struct dentry * qnx4_lookup(struct inode *dir, struct dentry *dentry, unsigned i
 	brelse(bh);
 
 	foundinode = qnx4_iget(dir->i_sb, ino);
-	if (IS_ERR(foundinode)) {
+	if (IS_ERR(foundinode))
 		QNX4DEBUG((KERN_ERR "qnx4: lookup->iget -> error %ld\n",
 			   PTR_ERR(foundinode)));
-		return ERR_CAST(foundinode);
-	}
 out:
-	d_add(dentry, foundinode);
-
-	return NULL;
+	return d_splice_alias(foundinode, dentry);
 }