vserver 1.9.5.x5
[linux-2.6.git] / fs / jffs2 / erase.c
index f6efdba..8a00b27 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: erase.c,v 1.60 2004/06/30 17:26:15 dbrown Exp $
+ * $Id: erase.c,v 1.66 2004/11/16 20:36:11 dwmw2 Exp $
  *
  */
 
@@ -43,6 +43,7 @@ void jffs2_erase_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
                jffs2_erase_succeeded(c, jeb);
                return;
        }
+       bad_offset = jeb->offset;
 #else /* Linux */
        struct erase_info *instr;
 
@@ -386,6 +387,7 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
                jeb->dirty_size = 0;
                jeb->wasted_size = 0;
        } else {
+               struct kvec vecs[1];
                struct jffs2_unknown_node marker = {
                        .magic =        cpu_to_je16(JFFS2_MAGIC_BITMASK),
                        .nodetype =     cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER),
@@ -394,8 +396,10 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
 
                marker.hdr_crc = cpu_to_je32(crc32(0, &marker, sizeof(struct jffs2_unknown_node)-4));
 
-               /* We only write the header; the rest was noise or padding anyway */
-               ret = jffs2_flash_write(c, jeb->offset, sizeof(marker), &retlen, (char *)&marker);
+               vecs[0].iov_base = (unsigned char *) &marker;
+               vecs[0].iov_len = sizeof(marker);
+               ret = jffs2_flash_direct_writev(c, vecs, 1, jeb->offset, &retlen);
+               
                if (ret) {
                        printk(KERN_WARNING "Write clean marker to block at 0x%08x failed: %d\n",
                               jeb->offset, ret);