summaryrefslogtreecommitdiff
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2022-03-20 23:11:17 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2022-04-25 15:13:02 -0700
commita22bb5526d7dd627b94a7ee22e5a98c36e39fceb (patch)
treebea175551d6d288f9e347410966bf1f3719984c7 /fs/f2fs/gc.c
parentd615b5416f8a1afeb82d13b238f8152c572d59c0 (diff)
f2fs: check pinfile in gc_data_segment() in advance
In order to skip migrating section which contains data of pinned file in advance. Signed-off-by: Chao Yu <chao.yu@oppo.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index ea5b93b689cd..e83c07144d8f 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -1480,6 +1480,13 @@ next_step:
special_file(inode->i_mode))
continue;
+ if (is_inode_flag_set(inode, FI_PIN_FILE) &&
+ gc_type == FG_GC) {
+ f2fs_pin_file_control(inode, true);
+ iput(inode);
+ return submitted;
+ }
+
if (!f2fs_down_write_trylock(
&F2FS_I(inode)->i_gc_rwsem[WRITE])) {
iput(inode);