ext4: Rework the ext4_da_writepages() function
commita1d6cc563bfdf1bf2829d3e6ce4d8b774251796b
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Wed, 20 Aug 2008 01:55:02 +0000 (19 21:55 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 20 Aug 2008 01:55:02 +0000 (19 21:55 -0400)
treeee81b6842191beb85f3f3baab817d115633ba456
parentf3bd1f3fa8ca7ec70cfd87aa94dc5e1a260901f2
ext4: Rework the ext4_da_writepages() function

With the below changes we reserve credit needed to insert only one
extent resulting from a call to single get_block.  This makes sure we
don't take too much journal credits during writeout.  We also don't
limit the pages to write.  That means we loop through the dirty pages
building largest possible contiguous block request.  Then we issue a
single get_block request.  We may get less block that we requested.  If
so we would end up not mapping some of the buffer_heads.  That means
those buffer_heads are still marked delay.  Later in the writepage
callback via __mpage_writepage we redirty those pages.

We should also not limit/throttle wbc->nr_to_write in the filesystem
writepages callback. That cause wrong behaviour in
generic_sync_sb_inodes caused by wbc->nr_to_write being <= 0

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/inode.c