Commit 8300807f authored by Al Viro's avatar Al Viro

clean erofs_lookup()

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 5b394b2d
...@@ -223,18 +223,13 @@ static struct dentry *erofs_lookup(struct inode *dir, ...@@ -223,18 +223,13 @@ static struct dentry *erofs_lookup(struct inode *dir,
if (err == -ENOENT) { if (err == -ENOENT) {
/* negative dentry */ /* negative dentry */
inode = NULL; inode = NULL;
goto negative_out; } else if (unlikely(err)) {
} else if (unlikely(err)) inode = ERR_PTR(err);
return ERR_PTR(err); } else {
debugln("%s, %s (nid %llu) found, d_type %u", __func__,
debugln("%s, %s (nid %llu) found, d_type %u", __func__, dentry->d_name.name, nid, d_type);
dentry->d_name.name, nid, d_type); inode = erofs_iget(dir->i_sb, nid, d_type == EROFS_FT_DIR);
}
inode = erofs_iget(dir->i_sb, nid, d_type == EROFS_FT_DIR);
if (IS_ERR(inode))
return ERR_CAST(inode);
negative_out:
return d_splice_alias(inode, dentry); return d_splice_alias(inode, dentry);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment