From: Jaegeuk Kim Date: Sat, 5 Aug 2017 21:25:08 +0000 (-0700) Subject: f2fs: use IPU for cold files X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3537581a722402a1e6f0942cd0653035a9e09e21;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 6b871b492fd5..7f700e54b77d 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -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))