linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clean erofs_lookup()
@ 2018-10-10 19:01 Al Viro
  2018-10-10 23:09 ` Gao Xiang
  2018-10-16 11:11 ` [PATCH] " Chao Yu
  0 siblings, 2 replies; 5+ messages in thread
From: Al Viro @ 2018-10-10 19:01 UTC (permalink / raw)
  To: linux-erofs; +Cc: linux-fsdevel

	d_splice_alias() does the right thing when given
ERR_PTR(-E...) for inode.  No need for gotos, multiple
returns, etc. in there.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/drivers/staging/erofs/namei.c b/drivers/staging/erofs/namei.c
index 546a47156101..8cf0617d4ea0 100644
--- a/drivers/staging/erofs/namei.c
+++ b/drivers/staging/erofs/namei.c
@@ -223,18 +223,13 @@ static struct dentry *erofs_lookup(struct inode *dir,
 	if (err == -ENOENT) {
 		/* negative dentry */
 		inode = NULL;
-		goto negative_out;
-	} else if (unlikely(err))
-		return ERR_PTR(err);
-
-	debugln("%s, %s (nid %llu) found, d_type %u", __func__,
-		dentry->d_name.name, nid, d_type);
-
-	inode = erofs_iget(dir->i_sb, nid, d_type == EROFS_FT_DIR);
-	if (IS_ERR(inode))
-		return ERR_CAST(inode);
-
-negative_out:
+	} else if (unlikely(err)) {
+		inode = ERR_PTR(err);
+	} else {
+		debugln("%s, %s (nid %llu) found, d_type %u", __func__,
+			dentry->d_name.name, nid, d_type);
+		inode = erofs_iget(dir->i_sb, nid, d_type == EROFS_FT_DIR);
+	}
 	return d_splice_alias(inode, dentry);
 }
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-16 19:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-10 19:01 [PATCH] clean erofs_lookup() Al Viro
2018-10-10 23:09 ` Gao Xiang
2018-10-12 17:59   ` [PATCH RESEND] staging: erofs: " Gao Xiang
2018-10-13 16:37     ` Gao Xiang
2018-10-16 11:11 ` [PATCH] " Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).