diff options
| author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-08-05 14:25:08 -0700 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-09-08 13:47:44 +0200 |
| commit | a0b55d2aa35643d57516e62f516fe9694ed4b8bc (patch) | |
| tree | 0c9cbd0be4c1e8346159d8e845173e1f859a257b | |
| parent | 0df445864e3759b267bec51c1c68b8c711ef2311 (diff) | |
FROMLIST: f2fs: use IPU for cold files
(url: https://patchwork.kernel.org/patch/9886419/)
We expect cold files write data sequentially, but sometimes some of small data
can be updated, which incurs fragmentation.
Let's avoid that.
Change-Id: Ib4a8db92e05bc88b1c7809707078efd249421045
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| -rw-r--r-- | fs/f2fs/segment.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index ebd7df66b..a60d05729 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -576,6 +576,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)) |
