Skip to contentSkip to conversation

f2fs: Remove unused curseg_segno() and curseg_alloc_type()

PATCH Applied Zhan Xusheng 3 participants 3 messages Jun 26 – Aug 5 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: Remove unused curseg_segno() and curseg_alloc_type()

The only callers of curseg_segno() and curseg_alloc_type() were removed by commit 5a4fed7cd97a ("f2fs: simplify do_checkpoint"); both helpers have been unused since then.

Being static inline functions they do not trigger -Wunused-function, so the dead code has gone unnoticed. Remove them. No functional change.

---
 fs/f2fs/segment.h | 14 --------------
 1 file changed, 14 deletions(-)
fs/f2fs/segment.h +0 -14
index b0c06b3580b4..33a2257da1e6 100644
@@ -796,20 +796,6 @@ F2FS_IPU_POLICY(F2FS_IPU_ASYNC);
 F2FS_IPU_POLICY(F2FS_IPU_NOCACHE);
 F2FS_IPU_POLICY(F2FS_IPU_HONOR_OPU_WRITE);
 
-static inline unsigned int curseg_segno(struct f2fs_sb_info *sbi,
-		int type)
-{
-	struct curseg_info *curseg = CURSEG_I(sbi, type);
-	return curseg->segno;
-}
-
-static inline unsigned char curseg_alloc_type(struct f2fs_sb_info *sbi,
-		int type)
-{
-	struct curseg_info *curseg = CURSEG_I(sbi, type);
-	return curseg->alloc_type;
-}
-
 static inline bool valid_main_segno(struct f2fs_sb_info *sbi,
 		unsigned int segno)
 {
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Zhan Xusheng

The only callers of curseg_segno() and curseg_alloc_type() were removed by commit 5a4fed7cd97a ("f2fs: simplify do_checkpoint"); both helpers have been unused since then.

Being static inline functions they do not trigger -Wunused-function, so the dead code has gone unnoticed. Remove them. No functional change.

Thanks,

#2 lore raw
In reply to Zhan Xusheng
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 8 lines · On Fri, 26 Jun 2026 11:07:28 +0800 you wrote:

The only callers of curseg_segno() and curseg_alloc_type() were removed by commit 5a4fed7cd97a ("f2fs: simplify do_checkpoint"); both helpers have been unused since then.

Being static inline functions they do not trigger -Wunused-function, so the dead code has gone unnoticed. Remove them. No functional change.

[...]

Here is the summary with links:
- [f2fs-dev] f2fs: Remove unused curseg_segno() and curseg_alloc_type()

    https://git.kernel.org/jaegeuk/f2fs/c/0f046e45afb7

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html