Skip to content

Commit

Permalink
configfs: simplify the configfs_dirent_is_ready
Browse files Browse the repository at this point in the history
Return the error directly instead of using a goto.

Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
Christoph Hellwig committed Aug 25, 2021
1 parent 417b962 commit 899587c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/configfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,8 @@ static struct dentry * configfs_lookup(struct inode *dir,
* not complete their initialization, since the dentries of the
* attributes won't be instantiated.
*/
err = -ENOENT;
if (!configfs_dirent_is_ready(parent_sd))
goto out;
return ERR_PTR(-ENOENT);

list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
if (sd->s_type & CONFIGFS_NOT_PINNED) {
Expand All @@ -493,7 +492,6 @@ static struct dentry * configfs_lookup(struct inode *dir,
return NULL;
}

out:
return ERR_PTR(err);
}

Expand Down

0 comments on commit 899587c

Please sign in to comment.