aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-08-05 14:25:08 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2017-08-15 10:40:11 -0700
commit3537581a722402a1e6f0942cd0653035a9e09e21 (patch)
treea9feafd55e260848b60cbf03dfdfa4ebd0b2785c /fs/f2fs/segment.h
parentf2fs: fix the size value in __check_sit_bitmap (diff)
downloadlinux-dev-3537581a722402a1e6f0942cd0653035a9e09e21.tar.xz
linux-dev-3537581a722402a1e6f0942cd0653035a9e09e21.zip
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 <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r--fs/f2fs/segment.h4
1 files changed, 4 insertions, 0 deletions
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))