aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-09-01 12:02:51 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-09-12 10:30:41 -0700
commit7f3037a5ec0672e03f96d4b0b86169c4c48e479e (patch)
tree66b71b995cbd04ccfa395f6ac487c6204c03b32a /fs/f2fs/gc.c
parentf2fs: forbid to do fstrim if fs has some error (diff)
downloadlinux-dev-7f3037a5ec0672e03f96d4b0b86169c4c48e479e.tar.xz
linux-dev-7f3037a5ec0672e03f96d4b0b86169c4c48e479e.zip
f2fs: check free_sections for defragmentation
Fix wrong condition check for defragmentation of a file. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index cdc44a67485f..24acbbbd0b1d 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -439,7 +439,7 @@ next_step:
struct node_info ni;
/* stop BG_GC if there is not enough free sections. */
- if (gc_type == BG_GC && has_not_enough_free_secs(sbi, 0))
+ if (gc_type == BG_GC && has_not_enough_free_secs(sbi, 0, 0))
return;
if (check_valid_map(sbi, segno, off) == 0)
@@ -715,7 +715,7 @@ next_step:
nid_t nid = le32_to_cpu(entry->nid);
/* stop BG_GC if there is not enough free sections. */
- if (gc_type == BG_GC && has_not_enough_free_secs(sbi, 0))
+ if (gc_type == BG_GC && has_not_enough_free_secs(sbi, 0, 0))
return;
if (check_valid_map(sbi, segno, off) == 0)
@@ -916,7 +916,7 @@ gc_more:
goto stop;
}
- if (gc_type == BG_GC && has_not_enough_free_secs(sbi, sec_freed)) {
+ if (gc_type == BG_GC && has_not_enough_free_secs(sbi, sec_freed, 0)) {
gc_type = FG_GC;
/*
* If there is no victim and no prefree segment but still not
@@ -927,7 +927,7 @@ gc_more:
prefree_segments(sbi)) {
write_checkpoint(sbi, &cpc);
segno = NULL_SEGNO;
- } else if (has_not_enough_free_secs(sbi, 0)) {
+ } else if (has_not_enough_free_secs(sbi, 0, 0)) {
write_checkpoint(sbi, &cpc);
}
}
@@ -944,7 +944,7 @@ gc_more:
sbi->cur_victim_sec = NULL_SEGNO;
if (!sync) {
- if (has_not_enough_free_secs(sbi, sec_freed))
+ if (has_not_enough_free_secs(sbi, sec_freed, 0))
goto gc_more;
if (gc_type == FG_GC)