Blame view
fs/jffs2/writev.c
1.08 KB
1da177e4c Linux-2.6.12-rc2 |
1 2 3 |
/* * JFFS2 -- Journalling Flash File System, Version 2. * |
c00c310ea [JFFS2] Tidy up l... |
4 |
* Copyright © 2001-2007 Red Hat, Inc. |
1da177e4c Linux-2.6.12-rc2 |
5 6 7 8 9 |
* * Created by David Woodhouse <dwmw2@infradead.org> * * For licensing information, see the file 'LICENCE' in this directory. * |
1da177e4c Linux-2.6.12-rc2 |
10 11 12 13 14 |
*/ #include <linux/kernel.h> #include <linux/mtd/mtd.h> #include "nodelist.h" |
1da177e4c Linux-2.6.12-rc2 |
15 16 17 |
int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen) { |
8acff5e93 [JFFS2] Call summ... |
18 |
if (!jffs2_is_writebuffered(c)) { |
e631ddba5 [JFFS2] Add erase... |
19 20 |
if (jffs2_sum_active()) { int res; |
e631ddba5 [JFFS2] Add erase... |
21 22 23 24 25 |
res = jffs2_sum_add_kvec(c, vecs, count, (uint32_t) to); if (res) { return res; } } |
8acff5e93 [JFFS2] Call summ... |
26 |
} |
e631ddba5 [JFFS2] Add erase... |
27 |
|
1dbebd325 mtd: harmonize mt... |
28 |
return mtd_writev(c->mtd, vecs, count, to, retlen); |
1da177e4c Linux-2.6.12-rc2 |
29 |
} |
e631ddba5 [JFFS2] Add erase... |
30 31 32 33 |
int jffs2_flash_direct_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, const u_char *buf) { int ret; |
eda95cbf7 mtd: introduce mt... |
34 |
ret = mtd_write(c->mtd, ofs, len, retlen, buf); |
e631ddba5 [JFFS2] Add erase... |
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
if (jffs2_sum_active()) { struct kvec vecs[1]; int res; vecs[0].iov_base = (unsigned char *) buf; vecs[0].iov_len = len; res = jffs2_sum_add_kvec(c, vecs, 1, (uint32_t) ofs); if (res) { return res; } } return ret; } |