diff options
Diffstat (limited to 'fs/logfs/gc.c')
-rw-r--r-- | fs/logfs/gc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/logfs/gc.c b/fs/logfs/gc.c index 92949f95a901..76c242fbe1b0 100644 --- a/fs/logfs/gc.c +++ b/fs/logfs/gc.c | |||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | #include "logfs.h" | 8 | #include "logfs.h" |
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/slab.h> | ||
10 | 11 | ||
11 | /* | 12 | /* |
12 | * Wear leveling needs to kick in when the difference between low erase | 13 | * Wear leveling needs to kick in when the difference between low erase |
@@ -458,6 +459,14 @@ static void __logfs_gc_pass(struct super_block *sb, int target) | |||
458 | struct logfs_block *block; | 459 | struct logfs_block *block; |
459 | int round, progress, last_progress = 0; | 460 | int round, progress, last_progress = 0; |
460 | 461 | ||
462 | /* | ||
463 | * Doing too many changes to the segfile at once would result | ||
464 | * in a large number of aliases. Write the journal before | ||
465 | * things get out of hand. | ||
466 | */ | ||
467 | if (super->s_shadow_tree.no_shadowed_segments >= MAX_OBJ_ALIASES) | ||
468 | logfs_write_anchor(sb); | ||
469 | |||
461 | if (no_free_segments(sb) >= target && | 470 | if (no_free_segments(sb) >= target && |
462 | super->s_no_object_aliases < MAX_OBJ_ALIASES) | 471 | super->s_no_object_aliases < MAX_OBJ_ALIASES) |
463 | return; | 472 | return; |