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>
This commit is contained in:
parent
c9881425b5
commit
2d982d49c3
1 changed files with 4 additions and 0 deletions
|
@ -577,6 +577,10 @@ static inline bool need_inplace_update_policy(struct inode *inode,
|
||||||
if (test_opt(sbi, LFS))
|
if (test_opt(sbi, LFS))
|
||||||
return false;
|
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))
|
if (policy & (0x1 << F2FS_IPU_FORCE))
|
||||||
return true;
|
return true;
|
||||||
if (policy & (0x1 << F2FS_IPU_SSR) && need_SSR(sbi))
|
if (policy & (0x1 << F2FS_IPU_SSR) && need_SSR(sbi))
|
||||||
|
|
Loading…
Add table
Reference in a new issue