mtd/fs/jffs2 erase.c,1.54,1.55
David Woodhouse
dwmw2 at infradead.org
Thu Oct 16 06:21:13 EDT 2003
- Previous message: mtd/fs/jffs2 erase.c,1.53,1.54 gc.c,1.114,1.115
nodelist.c,1.80,1.81 nodelist.h,1.104,1.105 nodemgmt.c,1.102,1.103
scan.c,1.104,1.105 wbuf.c,1.53,1.54 write.c,1.75,1.76
- Next message: mtd/fs/jffs2 gc.c,1.115,1.116 nodelist.c,1.81,1.82
nodelist.h,1.105,1.106 nodemgmt.c,1.103,1.104 wbuf.c,1.54,1.55
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv32002
Modified Files:
erase.c
Log Message:
Write just the header of a cleanmarker, not extra random data from the stack.
Don't use ref_totlen()
Index: erase.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/erase.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- erase.c 16 Oct 2003 09:17:17 -0000 1.54
+++ erase.c 16 Oct 2003 10:21:10 -0000 1.55
@@ -370,29 +370,30 @@
.totlen = cpu_to_je32(c->cleanmarker_size)
};
- marker.hdr_crc = cpu_to_je32(crc32(0, &marker, je32_to_cpu(marker.totlen) - 4));
+ marker.hdr_crc = cpu_to_je32(crc32(0, &marker, sizeof(struct jffs2_unknown_node)-4));
- ret = jffs2_flash_write(c, jeb->offset, je32_to_cpu(marker.totlen), &retlen, (char *)&marker);
+ /* We only write the header; the rest was noise or padding anyway */
+ ret = jffs2_flash_write(c, jeb->offset, sizeof(marker), &retlen, (char *)&marker);
if (ret) {
printk(KERN_WARNING "Write clean marker to block at 0x%08x failed: %d\n",
jeb->offset, ret);
goto bad2;
}
- if (retlen != je32_to_cpu(marker.totlen)) {
+ if (retlen != sizeof(marker)) {
printk(KERN_WARNING "Short write to newly-erased block at 0x%08x: Wanted %d, got %zd\n",
- jeb->offset, je32_to_cpu(marker.totlen), retlen);
+ jeb->offset, sizeof(marker), retlen);
goto bad2;
}
marker_ref->next_in_ino = NULL;
marker_ref->next_phys = NULL;
marker_ref->flash_offset = jeb->offset | REF_NORMAL;
- marker_ref->__totlen = PAD(je32_to_cpu(marker.totlen));
+ marker_ref->__totlen = c->cleanmarker_size;
jeb->first_node = jeb->last_node = marker_ref;
- jeb->free_size = c->sector_size - ref_totlen(marker_ref);
- jeb->used_size = ref_totlen(marker_ref);
+ jeb->free_size = c->sector_size - c->cleanmarker_size;
+ jeb->used_size = c->cleanmarker_size;
jeb->dirty_size = 0;
jeb->wasted_size = 0;
}
- Previous message: mtd/fs/jffs2 erase.c,1.53,1.54 gc.c,1.114,1.115
nodelist.c,1.80,1.81 nodelist.h,1.104,1.105 nodemgmt.c,1.102,1.103
scan.c,1.104,1.105 wbuf.c,1.53,1.54 write.c,1.75,1.76
- Next message: mtd/fs/jffs2 gc.c,1.115,1.116 nodelist.c,1.81,1.82
nodelist.h,1.105,1.106 nodemgmt.c,1.103,1.104 wbuf.c,1.54,1.55
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the linux-mtd-cvs
mailing list