f2fs: remove gc_urgent_high_limited for cleanup
authorChao Yu <chao.yu@oppo.com>
Sat, 20 Aug 2022 03:06:00 +0000 (11:06 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 30 Aug 2022 04:15:51 +0000 (21:15 -0700)
Remove redundant sbi->gc_urgent_high_limited.

Signed-off-by: Chao Yu <chao.yu@oppo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h
fs/f2fs/gc.c
fs/f2fs/sysfs.c

index 809419a258ed205364ba65dc029a7ea69c81429b..6770210aae7046c44cd1e9ea1d847ba850e6e428 100644 (file)
@@ -1731,7 +1731,6 @@ struct f2fs_sb_info {
        unsigned int gc_mode;                   /* current GC state */
        unsigned int next_victim_seg[2];        /* next segment in victim section */
        spinlock_t gc_urgent_high_lock;
-       bool gc_urgent_high_limited;            /* indicates having limited trial count */
        unsigned int gc_urgent_high_remaining;  /* remaining trial count for GC_URGENT_HIGH */
 
        /* for skip statistic */
index 2a3816c20f846e9a765f70f13d4072c7215ff60f..fd400d148afb206129808a0228add51e71b169c0 100644 (file)
@@ -97,10 +97,10 @@ static int gc_thread_func(void *data)
                 */
                if (sbi->gc_mode == GC_URGENT_HIGH) {
                        spin_lock(&sbi->gc_urgent_high_lock);
-                       if (sbi->gc_urgent_high_limited &&
-                                       !sbi->gc_urgent_high_remaining--) {
-                               sbi->gc_urgent_high_limited = false;
-                               sbi->gc_mode = GC_NORMAL;
+                       if (sbi->gc_urgent_high_remaining) {
+                               sbi->gc_urgent_high_remaining--;
+                               if (!sbi->gc_urgent_high_remaining)
+                                       sbi->gc_mode = GC_NORMAL;
                        }
                        spin_unlock(&sbi->gc_urgent_high_lock);
                }
index eba5fb1629d7145479601bcc6f94e4016bc2df6d..39ebf0ad133a98332ae4605a31fb034d9012bfe6 100644 (file)
@@ -527,7 +527,6 @@ out:
 
        if (!strcmp(a->attr.name, "gc_urgent_high_remaining")) {
                spin_lock(&sbi->gc_urgent_high_lock);
-               sbi->gc_urgent_high_limited = t != 0;
                sbi->gc_urgent_high_remaining = t;
                spin_unlock(&sbi->gc_urgent_high_lock);