From: Chao Yu <chao@kernel.org>
To: Yangtao Li <frank.li@vivo.com>, jaegeuk@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: cleanup in f2fs_create_flush_cmd_control() and f2fs_start_gc_thread()
Date: Thu, 27 Oct 2022 21:19:44 +0800 [thread overview]
Message-ID: <38e9d711-a3c6-3f02-19c4-9d298d386e4c@kernel.org> (raw)
In-Reply-To: <20221027102447.75708-1-frank.li@vivo.com>
On 2022/10/27 18:24, Yangtao Li wrote:
> Just cleanup for readable, no functional changes.
How about doing such cleanup in one patch?
Thanks,
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> fs/f2fs/gc.c | 14 ++++++--------
> fs/f2fs/segment.c | 3 +--
> 2 files changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 674a905063db..85d16f4106de 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -171,13 +171,10 @@ int f2fs_start_gc_thread(struct f2fs_sb_info *sbi)
> {
> struct f2fs_gc_kthread *gc_th;
> dev_t dev = sbi->sb->s_bdev->bd_dev;
> - int err = 0;
>
> gc_th = f2fs_kmalloc(sbi, sizeof(struct f2fs_gc_kthread), GFP_KERNEL);
> - if (!gc_th) {
> - err = -ENOMEM;
> - goto out;
> - }
> + if (!gc_th)
> + return -ENOMEM;
>
> gc_th->urgent_sleep_time = DEF_GC_THREAD_URGENT_SLEEP_TIME;
> gc_th->min_sleep_time = DEF_GC_THREAD_MIN_SLEEP_TIME;
> @@ -192,12 +189,13 @@ int f2fs_start_gc_thread(struct f2fs_sb_info *sbi)
> sbi->gc_thread->f2fs_gc_task = kthread_run(gc_thread_func, sbi,
> "f2fs_gc-%u:%u", MAJOR(dev), MINOR(dev));
> if (IS_ERR(gc_th->f2fs_gc_task)) {
> - err = PTR_ERR(gc_th->f2fs_gc_task);
> + int err = PTR_ERR(gc_th->f2fs_gc_task);
> kfree(gc_th);
> sbi->gc_thread = NULL;
> + return err;
> }
> -out:
> - return err;
> +
> + return 0;
> }
>
> void f2fs_stop_gc_thread(struct f2fs_sb_info *sbi)
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 282616e6852a..becceee8e337 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -638,7 +638,6 @@ int f2fs_create_flush_cmd_control(struct f2fs_sb_info *sbi)
> {
> dev_t dev = sbi->sb->s_bdev->bd_dev;
> struct flush_cmd_control *fcc;
> - int err;
>
> if (SM_I(sbi)->fcc_info) {
> fcc = SM_I(sbi)->fcc_info;
> @@ -662,7 +661,7 @@ int f2fs_create_flush_cmd_control(struct f2fs_sb_info *sbi)
> fcc->f2fs_issue_flush = kthread_run(issue_flush_thread, sbi,
> "f2fs_flush-%u:%u", MAJOR(dev), MINOR(dev));
> if (IS_ERR(fcc->f2fs_issue_flush)) {
> - err = PTR_ERR(fcc->f2fs_issue_flush);
> + int err = PTR_ERR(fcc->f2fs_issue_flush);
> kfree(fcc);
> SM_I(sbi)->fcc_info = NULL;
> return err;
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
prev parent reply other threads:[~2022-10-27 13:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-27 10:24 [f2fs-dev] [PATCH 1/2] f2fs: cleanup in f2fs_create_flush_cmd_control() and f2fs_start_gc_thread() Yangtao Li via Linux-f2fs-devel
2022-10-27 10:24 ` [f2fs-dev] [PATCH 2/2] f2fs: fix return val in f2fs_start_ckpt_thread() Yangtao Li via Linux-f2fs-devel
2022-10-27 13:21 ` Chao Yu
2022-10-27 17:29 ` Jaegeuk Kim
2022-10-27 13:19 ` Chao Yu [this message]
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=38e9d711-a3c6-3f02-19c4-9d298d386e4c@kernel.org \
--to=chao@kernel.org \
--cc=frank.li@vivo.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).