summaryrefslogtreecommitdiff
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-11-28 12:43:44 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2022-12-08 20:32:10 +0300
commit1c8a8ec0a0e9a1176022a35c4daf04fe1594d270 (patch)
tree85e502a77361edbc89cc62c2df4b30856eadbff8 /fs/f2fs/segment.c
parent8a47d228de6a4fd4c751142fb27d56f385b3fe41 (diff)
downloadlinux-1c8a8ec0a0e9a1176022a35c4daf04fe1594d270.tar.xz
f2fs: remove struct segment_allocation default_salloc_ops
There is only single instance of these ops, so remove the indirection and call allocate_segment_by_default directly. Signed-off-by: Christoph Hellwig <hch@lst.de> 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.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 0ff451ea18f6..bbe6556799ce 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -2926,7 +2926,7 @@ static void __allocate_new_segment(struct f2fs_sb_info *sbi, int type,
return;
alloc:
old_segno = curseg->segno;
- SIT_I(sbi)->s_ops->allocate_segment(sbi, type, true);
+ allocate_segment_by_default(sbi, type, true);
locate_dirty_segment(sbi, old_segno);
}
@@ -2957,10 +2957,6 @@ void f2fs_allocate_new_segments(struct f2fs_sb_info *sbi)
f2fs_up_read(&SM_I(sbi)->curseg_lock);
}
-static const struct segment_allocation default_salloc_ops = {
- .allocate_segment = allocate_segment_by_default,
-};
-
bool f2fs_exist_trim_candidates(struct f2fs_sb_info *sbi,
struct cp_control *cpc)
{
@@ -3284,7 +3280,7 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
get_atssr_segment(sbi, type, se->type,
AT_SSR, se->mtime);
else
- sit_i->s_ops->allocate_segment(sbi, type, false);
+ allocate_segment_by_default(sbi, type, false);
}
/*
* segment dirty status should be updated after segment allocation,
@@ -4270,9 +4266,6 @@ static int build_sit_info(struct f2fs_sb_info *sbi)
return -ENOMEM;
#endif
- /* init SIT information */
- sit_i->s_ops = &default_salloc_ops;
-
sit_i->sit_base_addr = le32_to_cpu(raw_super->sit_blkaddr);
sit_i->sit_blocks = sit_segs << sbi->log_blocks_per_seg;
sit_i->written_valid_blocks = 0;