summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2023-04-04 12:00:51 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2023-04-10 10:58:44 -0700
commit19e0e21a51183d4e0784602f27e4db7b965077be (patch)
tree102d6179ae9eba6ec6a34a1e8f781d06fbae4d2d /fs/f2fs/segment.c
parentda6ea0b050fa720302b56fbb59307e7c7531a342 (diff)
downloadlinux-stable-19e0e21a51183d4e0784602f27e4db7b965077be.tar.gz
linux-stable-19e0e21a51183d4e0784602f27e4db7b965077be.tar.bz2
linux-stable-19e0e21a51183d4e0784602f27e4db7b965077be.zip
f2fs: remove struct victim_selection default_v_ops
There is only single instance of these ops, and Jaegeuk point out that: Originally this was intended to give a chance to provide other allocation option. Anyway, it seems quit hard to do it anymore. So remove the indirection and call f2fs_get_victim() directly. Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r--fs/f2fs/segment.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 45128694eefa..fc0734e4fb92 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -2875,7 +2875,6 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type,
int alloc_mode, unsigned long long age)
{
struct curseg_info *curseg = CURSEG_I(sbi, type);
- const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
unsigned segno = NULL_SEGNO;
unsigned short seg_type = curseg->seg_type;
int i, cnt;
@@ -2884,7 +2883,7 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type,
sanity_check_seg_type(sbi, seg_type);
/* f2fs_need_SSR() already forces to do this */
- if (!v_ops->get_victim(sbi, &segno, BG_GC, seg_type, alloc_mode, age)) {
+ if (!f2fs_get_victim(sbi, &segno, BG_GC, seg_type, alloc_mode, age)) {
curseg->next_segno = segno;
return 1;
}
@@ -2911,7 +2910,7 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type,
for (; cnt-- > 0; reversed ? i-- : i++) {
if (i == seg_type)
continue;
- if (!v_ops->get_victim(sbi, &segno, BG_GC, i, alloc_mode, age)) {
+ if (!f2fs_get_victim(sbi, &segno, BG_GC, i, alloc_mode, age)) {
curseg->next_segno = segno;
return 1;
}