linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH 1/3] f2fs: check pinfile in gc_data_segment() in advance
@ 2022-03-20 15:11 Chao Yu
  2022-03-20 15:11 ` [f2fs-dev] [PATCH 2/3] f2fs: don't set GC_FAILURE_PIN for background GC Chao Yu
  2022-03-20 15:11 ` [f2fs-dev] [PATCH 3/3] f2fs: give priority to select unpinned section for foreground GC Chao Yu
  0 siblings, 2 replies; 3+ messages in thread
From: Chao Yu @ 2022-03-20 15:11 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

In order to skip migrating section which contains data of pinned
file in advance.

Signed-off-by: Chao Yu <chao.yu@oppo.com>
---
 fs/f2fs/gc.c | 7 +++++++
 1 file changed, 7 insertions(+)

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 @@ 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);
-- 
2.32.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-20 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-20 15:11 [f2fs-dev] [PATCH 1/3] f2fs: check pinfile in gc_data_segment() in advance Chao Yu
2022-03-20 15:11 ` [f2fs-dev] [PATCH 2/3] f2fs: don't set GC_FAILURE_PIN for background GC Chao Yu
2022-03-20 15:11 ` [f2fs-dev] [PATCH 3/3] f2fs: give priority to select unpinned section for foreground GC Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).