mtd/fs/jffs2 wbuf.c,1.24,1.25
gleixner at infradead.org
gleixner at infradead.org
Sat Feb 15 06:31:59 EST 2003
Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv18106
Modified Files:
wbuf.c
Log Message:
Make JFFS2 dwmw2-prrof: enable usage of jffs2_flash_write for NAND
Index: wbuf.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/wbuf.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- wbuf.c 21 Jan 2003 18:11:29 -0000 1.24
+++ wbuf.c 15 Feb 2003 11:31:56 -0000 1.25
@@ -169,7 +169,7 @@
printk(KERN_CRIT "jffs2_flush_wbuf(): Write failed with %d\n",ret);
else
printk(KERN_CRIT "jffs2_flush_wbuf(): Write was short: %zd instead of %d\n",
- retlen, c->wbuf_pagesize);
+ retlen, c->wbuf_pagesize);
ret = -EIO;
/* CHECKME NAND
@@ -427,11 +427,19 @@
}
/*
- This is the entry for NOR-Flash. We use it also for NAND to flush wbuf
+ * This is the entry for flash write.
+ * Check, if we work on NAND FLASH, if so build an iovec and write it via vritev
*/
int jffs2_flash_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, const u_char *buf)
{
- return c->mtd->write(c->mtd, ofs, len, retlen, buf);
+ struct iovec vecs[1];
+
+ if (jffs2_can_mark_obsolete(c))
+ return c->mtd->write(c->mtd, ofs, len, retlen, buf);
+
+ vecs[0].iov_base = (unsigned char *) buf;
+ vecs[0].iov_len = len;
+ return jffs2_flash_writev(c, vecs, 1, ofs, retlen);
}
/*
More information about the linux-mtd-cvs
mailing list