Skip to content

Commit

Permalink
[JFFS2] Call summary collector for all mtd devices with writev support
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
Ferenc Havasi authored and Thomas Gleixner committed Nov 6, 2005
1 parent 1b01d97 commit 8acff5e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions fs/jffs2/writev.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* For licensing information, see the file 'LICENCE' in this directory.
*
* $Id: writev.c,v 1.7 2005/09/07 08:34:55 havasi Exp $
* $Id: writev.c,v 1.8 2005/09/09 15:11:58 havasi Exp $
*
*/

Expand Down Expand Up @@ -42,18 +42,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);
}
}
Expand Down

0 comments on commit 8acff5e

Please sign in to comment.