[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [microblaze-uclinux] New PetaLinux release - call for patches and bug reports
Hi!
I had a problem with fwrite() for files in the jffs2 filesystem. Usually it had normal speed, but sometimes it was very slow - till several seconds. The problem was exceedingly conspicuous in case of flashing several files >1MB (firmware update).
The reason is the internal buffering of flash sectors to be erased. The start-of-erasing treshold (which is a sector count) is quite big. The following patch handles that and I have an acceptably smoother flash speed now. I can see that in my GUI's progress dialog. Furthermore I don't have to struggle with timeouts on GUI side anymore, when a flash step suddenly hangs too long and for 'unknown' reasons.
CU, Falk Br.
Index: trunk/software/linux-2.6.x-petalogix/fs/jffs2/fs.c
===================================================================
--- trunk/software/linux-2.6.x-petalogix/fs/jffs2/fs.c (revision 2)
+++ trunk/software/linux-2.6.x-petalogix/fs/jffs2/fs.c (revision 168)
@@ -379,30 +379,31 @@
if (!(*flags & MS_RDONLY))
jffs2_start_garbage_collect_thread(c);
*flags |= MS_NOATIME;
return 0;
}
void jffs2_write_super (struct super_block *sb)
{
struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
sb->s_dirt = 0;
if (sb->s_flags & MS_RDONLY)
return;
D1(printk(KERN_DEBUG "jffs2_write_super()\n"));
jffs2_garbage_collect_trigger(c);
- jffs2_erase_pending_blocks(c, 0);
+ jffs2_erase_pending_blocks(c, 3); // don't erease all block at once but only max. 3 to avoid blocking of subsequent write commands
jffs2_flush_wbuf_gc(c, 0);
}
/* jffs2_new_inode: allocate a new inode and inocache, add it to the hash,
fill in the raw_inode while you're at it. */
struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct jffs2_raw_inode *ri)
{
struct inode *inode;
struct super_block *sb = dir_i->i_sb;
struct jffs2_sb_info *c;
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/