vserver 1.9.5.x5
[linux-2.6.git] / fs / jffs2 / write.c
index 1253c48..80a5db5 100644 (file)
@@ -3,11 +3,11 @@
  *
  * Copyright (C) 2001-2003 Red Hat, Inc.
  *
- * Created by David Woodhouse <dwmw2@redhat.com>
+ * Created by David Woodhouse <dwmw2@infradead.org>
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: write.c,v 1.85 2004/07/13 08:58:25 dwmw2 Exp $
+ * $Id: write.c,v 1.87 2004/11/16 20:36:12 dwmw2 Exp $
  *
  */
 
@@ -213,8 +213,10 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
        jffs2_add_physical_node_ref(c, raw);
 
        /* Link into per-inode list */
+       spin_lock(&c->erase_completion_lock);
        raw->next_in_ino = f->inocache->nodes;
        f->inocache->nodes = raw;
+       spin_unlock(&c->erase_completion_lock);
 
        D1(printk(KERN_DEBUG "jffs2_write_dnode wrote node at 0x%08x(%d) with dsize 0x%x, csize 0x%x, node_crc 0x%08x, data_crc 0x%08x, totlen 0x%08x\n",
                  flash_ofs, ref_flags(raw), je32_to_cpu(ri->dsize), 
@@ -333,8 +335,10 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff
        raw->flash_offset |= REF_PRISTINE;
        jffs2_add_physical_node_ref(c, raw);
 
+       spin_lock(&c->erase_completion_lock);
        raw->next_in_ino = f->inocache->nodes;
        f->inocache->nodes = raw;
+       spin_unlock(&c->erase_completion_lock);
 
        if (retried) {
                ACCT_SANITY_CHECK(c,NULL);