aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
authorFerenc Havasi <havasi@inf.u-szeged.hu>2005-09-09 11:12:01 -0400
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-11-06 15:37:07 -0500
commit8acff5e93488e4da653097bd5e50662ee0985867 (patch)
tree90172da041ac2b11dc3fc0e881146b6c50b290db /fs/jffs2
parent1b01d9798d58bf28a40fede184482ebf39e63335 (diff)
[JFFS2] Call summary collector for all mtd devices with writev support
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. Signed-off-by: Ferenc Havasi <havasi@inf.u-szeged.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/writev.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/jffs2/writev.c b/fs/jffs2/writev.c
index 6d8c27c5e723..c638ae1008de 100644
--- a/fs/jffs2/writev.c
+++ b/fs/jffs2/writev.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in this directory. 8 * For licensing information, see the file 'LICENCE' in this directory.
9 * 9 *
10 * $Id: writev.c,v 1.7 2005/09/07 08:34:55 havasi Exp $ 10 * $Id: writev.c,v 1.8 2005/09/09 15:11:58 havasi Exp $
11 * 11 *
12 */ 12 */
13 13
@@ -42,18 +42,19 @@ static inline int mtd_fake_writev(struct mtd_info *mtd, const struct kvec *vecs,
42int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs, 42int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs,
43 unsigned long count, loff_t to, size_t *retlen) 43 unsigned long count, loff_t to, size_t *retlen)
44{ 44{
45 if (c->mtd->writev) 45 if (!jffs2_is_writebuffered(c)) {
46 return c->mtd->writev(c->mtd, vecs, count, to, retlen);
47 else {
48 if (jffs2_sum_active()) { 46 if (jffs2_sum_active()) {
49 int res; 47 int res;
50
51 res = jffs2_sum_add_kvec(c, vecs, count, (uint32_t) to); 48 res = jffs2_sum_add_kvec(c, vecs, count, (uint32_t) to);
52 if (res) { 49 if (res) {
53 return res; 50 return res;
54 } 51 }
55 } 52 }
53 }
56 54
55 if (c->mtd->writev)
56 return c->mtd->writev(c->mtd, vecs, count, to, retlen);
57 else {
57 return mtd_fake_writev(c->mtd, vecs, count, to, retlen); 58 return mtd_fake_writev(c->mtd, vecs, count, to, retlen);
58 } 59 }
59} 60}