Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3537581a authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: use IPU for cold files



We expect cold files write data sequentially, but sometimes some of small data
can be updated, which incurs fragmentation.
Let's avoid that.

Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 008396e1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -577,6 +577,10 @@ static inline bool need_inplace_update_policy(struct inode *inode,
	if (test_opt(sbi, LFS))
		return false;

	/* if this is cold file, we should overwrite to avoid fragmentation */
	if (file_is_cold(inode))
		return true;

	if (policy & (0x1 << F2FS_IPU_FORCE))
		return true;
	if (policy & (0x1 << F2FS_IPU_SSR) && need_SSR(sbi))