ocfs2: remove goto statement in ocfs2_check_dir_for_entry()
authorDaeseok Youn <daeseok.youn@gmail.com>
Tue, 14 Apr 2015 22:43:30 +0000 (15:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 Apr 2015 23:48:58 +0000 (16:48 -0700)
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/dir.c

index b08050bd3f2ef81a2c2f053042ac7e9e763e3718..2241a19b9335e25bba3b7fb1bed2afd6ea8c72f8 100644 (file)
@@ -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;
 }