Skip to content

Commit 4ccf2f1

Browse files
dedekindDavid Woodhouse
authored andcommitted
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>
1 parent bac9727 commit 4ccf2f1

1 file changed

Lines changed: 1 addition & 26 deletions

File tree

‎fs/jffs2/writev.c‎

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,6 @@
1313
#include <linux/mtd/mtd.h>
1414
#include "nodelist.h"
1515

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 */
19-
static 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-
4116
int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs,
4217
unsigned long count, loff_t to, size_t *retlen)
4318
{
@@ -54,7 +29,7 @@ int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs,
5429
if (c->mtd->writev)
5530
return mtd_writev(c->mtd, vecs, count, to, retlen);
5631
else {
57-
return mtd_fake_writev(c->mtd, vecs, count, to, retlen);
32+
return default_mtd_writev(c->mtd, vecs, count, to, retlen);
5833
}
5934
}
6035

0 commit comments

Comments
 (0)