Skip to content

Commit

Permalink
ocfs2: remove goto statement in ocfs2_check_dir_for_entry()
Browse files Browse the repository at this point in the history
Signed-off-by: Daeseok Youn <[email protected]>
Reviewed-by: Joseph Qi <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
daeseokyoun authored and torvalds committed Apr 14, 2015
1 parent a47726b commit 7c01ad8
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions fs/ocfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -2047,22 +2047,19 @@ int ocfs2_check_dir_for_entry(struct inode *dir,
const char *name,
int namelen)
{
int ret;
int ret = 0;
struct ocfs2_dir_lookup_result lookup = { NULL, };

trace_ocfs2_check_dir_for_entry(
(unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name);

ret = -EEXIST;
if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0)
goto bail;
if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0) {
ret = -EEXIST;
mlog_errno(ret);
}

ret = 0;
bail:
ocfs2_free_dir_lookup_result(&lookup);

if (ret)
mlog_errno(ret);
return ret;
}

Expand Down

0 comments on commit 7c01ad8

Please sign in to comment.