[PATCH v2 05/13] f2fs: set inline tail flag when create inode

From: Wu Bo
Date: Tue Sep 10 2024 - 23:44:25 EST


Set inline tail flag to enable this feature when new inode is created.
Inherit the conditions from inline data.

Signed-off-by: Wu Bo <bo.wu@xxxxxxxx>
---
fs/f2fs/namei.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 38b4750475db..13c295ea19de 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -315,6 +315,9 @@ static struct inode *f2fs_new_inode(struct mnt_idmap *idmap,
/* Should enable inline_data after compression set */
if (test_opt(sbi, INLINE_DATA) && f2fs_may_inline_data(inode))
set_inode_flag(inode, FI_INLINE_DATA);
+ /* Inherit the conditions from inline data */
+ if (test_opt(sbi, INLINE_TAIL) && f2fs_has_inline_data(inode))
+ set_inode_flag(inode, FI_INLINE_TAIL);

if (name && !test_opt(sbi, DISABLE_EXT_IDENTIFY))
set_file_temperature(sbi, inode, name);
--
2.35.3