[PATCH 2/2] f2fs: fix to use sb_{start,end}_intwrite{_trylock,}() in gc_thread_func()

From: Chao Yu
Date: Thu Jun 06 2024 - 06:13:04 EST


Since background GC is f2fs inner operation, so, let's use
sb_{start,end}_intwrite{_trylock,}() instead of
sb_{start,end}_write{_trylock,}() in gc_thread_func().

Signed-off-by: Chao Yu <chao@xxxxxxxxxx>
---
fs/f2fs/gc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index ef667fec9a12..004587ac5530 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -76,7 +76,7 @@ static int gc_thread_func(void *data)
f2fs_stop_checkpoint(sbi, false,
STOP_CP_REASON_FAULT_INJECT);

- if (!sb_start_write_trylock(sbi->sb)) {
+ if (!sb_start_intwrite_trylock(sbi->sb)) {
stat_other_skip_bggc_count(sbi);
continue;
}
@@ -163,7 +163,7 @@ static int gc_thread_func(void *data)
}
spin_unlock(&sbi->gc_remaining_trials_lock);
}
- sb_end_write(sbi->sb);
+ sb_end_intwrite(sbi->sb);

} while (!kthread_should_stop());
return 0;
--
2.40.1