[JFFS2] Fix ACL vs. mode handling.
[safe/jmp/linux-2.6] / fs / jffs2 / summary.c
index e52cef5..2a77d3f 100644 (file)
@@ -1,20 +1,17 @@
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
- * Copyright (C) 2004  Ferenc Havasi <havasi@inf.u-szeged.hu>,
- *                     Zoltan Sogor <weth@inf.u-szeged.hu>,
- *                     Patrik Kluba <pajko@halom.u-szeged.hu>,
- *                     University of Szeged, Hungary
- *               2006  KaiGai Kohei <kaigai@ak.jp.nec.com>
+ * Copyright © 2004  Ferenc Havasi <havasi@inf.u-szeged.hu>,
+ *                  Zoltan Sogor <weth@inf.u-szeged.hu>,
+ *                  Patrik Kluba <pajko@halom.u-szeged.hu>,
+ *                  University of Szeged, Hungary
+ *            2006  KaiGai Kohei <kaigai@ak.jp.nec.com>
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: summary.c,v 1.4 2005/09/26 11:37:21 havasi Exp $
- *
  */
 
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/mtd/mtd.h>
 #include <linux/pagemap.h>
 
 int jffs2_sum_init(struct jffs2_sb_info *c)
 {
-       c->summary = kmalloc(sizeof(struct jffs2_summary), GFP_KERNEL);
+       c->summary = kzalloc(sizeof(struct jffs2_summary), GFP_KERNEL);
 
        if (!c->summary) {
                JFFS2_WARNING("Can't allocate memory for summary information!\n");
                return -ENOMEM;
        }
 
-       memset(c->summary, 0, sizeof(struct jffs2_summary));
-
        c->summary->sum_buf = vmalloc(c->sector_size);
 
        if (!c->summary->sum_buf) {
@@ -398,6 +393,8 @@ static int jffs2_sum_process_sum_data(struct jffs2_sb_info *c, struct jffs2_eras
        for (i=0; i<je32_to_cpu(summary->sum_num); i++) {
                dbg_summary("processing summary index %d\n", i);
 
+               cond_resched();
+
                /* Make sure there's a spare ref for dirty space */
                err = jffs2_prealloc_raw_node_refs(c, jeb, 2);
                if (err)