]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/jffs2/gc.c
Pull video into release branch
[linux-2.6-omap-h63xx.git] / fs / jffs2 / gc.c
index daff3341ff92b58cb72916678f69603e64ed5972..2d99e06ab223407a400cb31f3eeefae5f0d5bf7e 100644 (file)
@@ -1,14 +1,12 @@
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
- * Copyright (C) 2001-2003 Red Hat, Inc.
+ * Copyright © 2001-2007 Red Hat, Inc.
  *
  * Created by David Woodhouse <dwmw2@infradead.org>
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: gc.c,v 1.155 2005/11/07 11:14:39 gleixner Exp $
- *
  */
 
 #include <linux/kernel.h>
@@ -144,7 +142,8 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
                               c->unchecked_size);
                        jffs2_dbg_dump_block_lists_nolock(c);
                        spin_unlock(&c->erase_completion_lock);
-                       BUG();
+                       up(&c->alloc_sem);
+                       return -ENOSPC;
                }
 
                spin_unlock(&c->erase_completion_lock);
@@ -838,6 +837,8 @@ static int jffs2_garbage_collect_deletion_dirent(struct jffs2_sb_info *c, struct
 
                for (raw = f->inocache->nodes; raw != (void *)f->inocache; raw = raw->next_in_ino) {
 
+                       cond_resched();
+
                        /* We only care about obsolete ones */
                        if (!(ref_obsolete(raw)))
                                continue;