gc.c (c40e15a9a59f79e79d9500f1fd019321ec35b959) gc.c (45c98f5a58f36c35ecf5a149cbf69cf5fd022120)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/f2fs/gc.c
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 */
8#include <linux/fs.h>

--- 43 unchanged lines hidden (view full) ---

52 gc_th->gc_wake,
53 msecs_to_jiffies(wait_ms));
54
55 if (test_opt(sbi, GC_MERGE) && waitqueue_active(fggc_wq))
56 foreground = true;
57
58 /* give it a try one time */
59 if (gc_th->gc_wake)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/f2fs/gc.c
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 */
8#include <linux/fs.h>

--- 43 unchanged lines hidden (view full) ---

52 gc_th->gc_wake,
53 msecs_to_jiffies(wait_ms));
54
55 if (test_opt(sbi, GC_MERGE) && waitqueue_active(fggc_wq))
56 foreground = true;
57
58 /* give it a try one time */
59 if (gc_th->gc_wake)
60 gc_th->gc_wake = 0;
60 gc_th->gc_wake = false;
61
62 if (try_to_freeze()) {
63 stat_other_skip_bggc_count(sbi);
64 continue;
65 }
66 if (kthread_should_stop())
67 break;
68

--- 109 unchanged lines hidden (view full) ---

178 if (!gc_th)
179 return -ENOMEM;
180
181 gc_th->urgent_sleep_time = DEF_GC_THREAD_URGENT_SLEEP_TIME;
182 gc_th->min_sleep_time = DEF_GC_THREAD_MIN_SLEEP_TIME;
183 gc_th->max_sleep_time = DEF_GC_THREAD_MAX_SLEEP_TIME;
184 gc_th->no_gc_sleep_time = DEF_GC_THREAD_NOGC_SLEEP_TIME;
185
61
62 if (try_to_freeze()) {
63 stat_other_skip_bggc_count(sbi);
64 continue;
65 }
66 if (kthread_should_stop())
67 break;
68

--- 109 unchanged lines hidden (view full) ---

178 if (!gc_th)
179 return -ENOMEM;
180
181 gc_th->urgent_sleep_time = DEF_GC_THREAD_URGENT_SLEEP_TIME;
182 gc_th->min_sleep_time = DEF_GC_THREAD_MIN_SLEEP_TIME;
183 gc_th->max_sleep_time = DEF_GC_THREAD_MAX_SLEEP_TIME;
184 gc_th->no_gc_sleep_time = DEF_GC_THREAD_NOGC_SLEEP_TIME;
185
186 gc_th->gc_wake = 0;
186 gc_th->gc_wake = false;
187
188 sbi->gc_thread = gc_th;
189 init_waitqueue_head(&sbi->gc_thread->gc_wait_queue_head);
190 init_waitqueue_head(&sbi->gc_thread->fggc_wq);
191 sbi->gc_thread->f2fs_gc_task = kthread_run(gc_thread_func, sbi,
192 "f2fs_gc-%u:%u", MAJOR(dev), MINOR(dev));
193 if (IS_ERR(gc_th->f2fs_gc_task)) {
194 int err = PTR_ERR(gc_th->f2fs_gc_task);

--- 1999 unchanged lines hidden ---
187
188 sbi->gc_thread = gc_th;
189 init_waitqueue_head(&sbi->gc_thread->gc_wait_queue_head);
190 init_waitqueue_head(&sbi->gc_thread->fggc_wq);
191 sbi->gc_thread->f2fs_gc_task = kthread_run(gc_thread_func, sbi,
192 "f2fs_gc-%u:%u", MAJOR(dev), MINOR(dev));
193 if (IS_ERR(gc_th->f2fs_gc_task)) {
194 int err = PTR_ERR(gc_th->f2fs_gc_task);

--- 1999 unchanged lines hidden ---