Skip to content

Commit

Permalink
f2fs: check pinfile in gc_data_segment() in advance
Browse files Browse the repository at this point in the history
In order to skip migrating section which contains data of pinned
file in advance.

Signed-off-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
chaseyu authored and Jaegeuk Kim committed Apr 25, 2022
1 parent d615b54 commit a22bb55
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/f2fs/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,13 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
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);
Expand Down

0 comments on commit a22bb55

Please sign in to comment.