aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs/gc.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2010-05-06 10:56:07 +1000
committerJames Morris <jmorris@namei.org>2010-05-06 10:56:07 +1000
commit0ffbe2699cda6afbe08501098dff8a8c2fe6ae09 (patch)
tree81b1a2305d16c873371b65c5a863c0268036cefe /fs/logfs/gc.c
parentTOMOYO: Use GFP_NOFS rather than GFP_KERNEL. (diff)
parentMerge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 (diff)
downloadlinux-dev-0ffbe2699cda6afbe08501098dff8a8c2fe6ae09.tar.xz
linux-dev-0ffbe2699cda6afbe08501098dff8a8c2fe6ae09.zip
Merge branch 'master' into next
Diffstat (limited to 'fs/logfs/gc.c')
-rw-r--r--fs/logfs/gc.c9
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 @@
*/
#include "logfs.h"
#include <linux/sched.h>
+#include <linux/slab.h>
/*
* 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)
struct logfs_block *block;
int round, progress, last_progress = 0;
+ /*
+ * Doing too many changes to the segfile at once would result
+ * in a large number of aliases. Write the journal before
+ * things get out of hand.
+ */
+ if (super->s_shadow_tree.no_shadowed_segments >= MAX_OBJ_ALIASES)
+ logfs_write_anchor(sb);
+
if (no_free_segments(sb) >= target &&
super->s_no_object_aliases < MAX_OBJ_ALIASES)
return;