summaryrefslogtreecommitdiff
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-06-19 13:41:23 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2015-08-04 14:09:55 -0700
commit554df79e523d14dab475eb6650cb96617256ceea (patch)
treeab8c8bbf5febf51534f809ef9df49fecfaf0e4a3 /fs/f2fs/segment.c
parent1b38dc8e74a366b92986755c304591e330f3c3e0 (diff)
f2fs: shrink extent_cache entries
This patch registers shrinking extent_caches. Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r--fs/f2fs/segment.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index d5ee99258cbc..f7bfc3b7d934 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -304,7 +304,8 @@ void f2fs_balance_fs(struct f2fs_sb_info *sbi)
void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi)
{
/* try to shrink extent cache when there is no enough memory */
- f2fs_shrink_extent_tree(sbi, EXTENT_CACHE_SHRINK_NUMBER);
+ if (!available_free_memory(sbi, EXTENT_CACHE))
+ f2fs_shrink_extent_tree(sbi, EXTENT_CACHE_SHRINK_NUMBER);
/* check the # of cached NAT entries */
if (!available_free_memory(sbi, NAT_ENTRIES))