From: Joseph Qi <joseph.qi@huawei.com>
To: Daeseok Youn <daeseok.youn@gmail.com>
Cc: mfasheh@suse.com, akpm@linux-foundation.org,
ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org
Subject: [Ocfs2-devel] [PATCH 4/4 RESEND] ocfs2: remove goto statement in ocfs2_check_dir_for_entry()
Date: Thu, 19 Mar 2015 19:17:00 +0800 [thread overview]
Message-ID: <550AB02C.20507@huawei.com> (raw)
In-Reply-To: <20150227235329.GA12979@devel.8.8.4.4>
On 2015/2/28 7:53, Daeseok Youn wrote:
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
> ---
> RESEND: this patch is rebased by 1/4.
>
> fs/ocfs2/dir.c | 13 +++++--------
> 1 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
> index c63f2b6..b3ab2a6 100644
> --- a/fs/ocfs2/dir.c
> +++ b/fs/ocfs2/dir.c
> @@ -2043,22 +2043,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;
> }
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Joseph Qi <joseph.qi@huawei.com>
To: Daeseok Youn <daeseok.youn@gmail.com>
Cc: <mfasheh@suse.com>, <akpm@linux-foundation.org>,
<ocfs2-devel@oss.oracle.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [Ocfs2-devel] [PATCH 4/4 RESEND] ocfs2: remove goto statement in ocfs2_check_dir_for_entry()
Date: Thu, 19 Mar 2015 19:17:00 +0800 [thread overview]
Message-ID: <550AB02C.20507@huawei.com> (raw)
In-Reply-To: <20150227235329.GA12979@devel.8.8.4.4>
On 2015/2/28 7:53, Daeseok Youn wrote:
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
> ---
> RESEND: this patch is rebased by 1/4.
>
> fs/ocfs2/dir.c | 13 +++++--------
> 1 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
> index c63f2b6..b3ab2a6 100644
> --- a/fs/ocfs2/dir.c
> +++ b/fs/ocfs2/dir.c
> @@ -2043,22 +2043,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;
> }
>
>
next prev parent reply other threads:[~2015-03-19 11:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 23:53 [Ocfs2-devel] [PATCH 4/4 RESEND] ocfs2: remove goto statement in ocfs2_check_dir_for_entry() Daeseok Youn
2015-02-27 23:53 ` Daeseok Youn
2015-03-19 11:17 ` Joseph Qi [this message]
2015-03-19 11:17 ` [Ocfs2-devel] " Joseph Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=550AB02C.20507@huawei.com \
--to=joseph.qi@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=daeseok.youn@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mfasheh@suse.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.