mtd/fs/jffs2 writev.c,1.7,1.8

havasi at infradead.org havasi at infradead.org
Fri Sep 9 11:12:01 EDT 2005


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv1862

Modified Files:
	writev.c 
Log Message:
[JFFS2] summary bugfix (blkmtd related)

Do the summary collection in the right place. If the device
was not writebuffered but had c->mtd->writev function
(e.g. blkmtd) the summary collector function was not called.



Index: writev.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/writev.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- writev.c	7 Sep 2005 08:34:55 -0000	1.7
+++ writev.c	9 Sep 2005 15:11:58 -0000	1.8
@@ -42,18 +42,19 @@
 int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs,
 			      unsigned long count, loff_t to, size_t *retlen)
 {
-	if (c->mtd->writev)
-		return c->mtd->writev(c->mtd, vecs, count, to, retlen);
-	else {
+	if (!jffs2_is_writebuffered(c)) {
 		if (jffs2_sum_active()) {
 			int res;
-
 			res = jffs2_sum_add_kvec(c, vecs, count, (uint32_t) to);
 			if (res) {
 				return res;
 			}
 		}
+	}
 
+	if (c->mtd->writev)
+		return c->mtd->writev(c->mtd, vecs, count, to, retlen);
+	else {
 		return mtd_fake_writev(c->mtd, vecs, count, to, retlen);
 	}
 }





More information about the linux-mtd-cvs mailing list