Commit a22bb552 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

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: default avatarChao Yu <chao.yu@oppo.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent d615b541
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment