aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-12-30 08:48:55 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:26:04 -0500
commit4ccf2f1349e681401b5fae73efc87b8d2d70ce0e (patch)
treeb62d5d22d67c80918c4c7a40676062e54ae7e236 /fs/jffs2
parentbac972777403f810d83062dd0d0303746e466ece (diff)
jffs: remove custom mtd_fake_writev function
Instead, use 'default_mtd_writev()' function which MTD provides. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/writev.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/fs/jffs2/writev.c b/fs/jffs2/writev.c
index d0ef068709ad..8d704073f8b0 100644
--- a/fs/jffs2/writev.c
+++ b/fs/jffs2/writev.c
@@ -13,31 +13,6 @@
13#include <linux/mtd/mtd.h> 13#include <linux/mtd/mtd.h>
14#include "nodelist.h" 14#include "nodelist.h"
15 15
16/* This ought to be in core MTD code. All registered MTD devices
17 without writev should have this put in place. Bug the MTD
18 maintainer */
19static inline int mtd_fake_writev(struct mtd_info *mtd, const struct kvec *vecs,
20 unsigned long count, loff_t to, size_t *retlen)
21{
22 unsigned long i;
23 size_t totlen = 0, thislen;
24 int ret = 0;
25
26 for (i=0; i<count; i++) {
27 if (!vecs[i].iov_len)
28 continue;
29 ret = mtd_write(mtd, to, vecs[i].iov_len, &thislen,
30 vecs[i].iov_base);
31 totlen += thislen;
32 if (ret || thislen != vecs[i].iov_len)
33 break;
34 to += vecs[i].iov_len;
35 }
36 if (retlen)
37 *retlen = totlen;
38 return ret;
39}
40
41int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs, 16int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs,
42 unsigned long count, loff_t to, size_t *retlen) 17 unsigned long count, loff_t to, size_t *retlen)
43{ 18{
@@ -54,7 +29,7 @@ int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs,
54 if (c->mtd->writev) 29 if (c->mtd->writev)
55 return mtd_writev(c->mtd, vecs, count, to, retlen); 30 return mtd_writev(c->mtd, vecs, count, to, retlen);
56 else { 31 else {
57 return mtd_fake_writev(c->mtd, vecs, count, to, retlen); 32 return default_mtd_writev(c->mtd, vecs, count, to, retlen);
58 } 33 }
59} 34}
60 35