]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/jffs2/writev.c
[ARM] pxa: corgi backlight driver should not select ssp drivers
[linux-2.6-omap-h63xx.git] / fs / jffs2 / writev.c
index 6d8c27c5e7232a0273f6312809efb69c1740862b..b9276b11bac69a8ce08666ccf6e28539e2bf2322 100644 (file)
@@ -1,14 +1,12 @@
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
- * Copyright (C) 2001, 2002 Red Hat, Inc.
+ * Copyright © 2001-2007 Red Hat, Inc.
  *
  * Created by David Woodhouse <dwmw2@infradead.org>
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: writev.c,v 1.7 2005/09/07 08:34:55 havasi Exp $
- *
  */
 
 #include <linux/kernel.h>
@@ -42,18 +40,19 @@ static inline int mtd_fake_writev(struct mtd_info *mtd, const struct kvec *vecs,
 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);
        }
 }