vfs: Avoid unnecessary WB_SYNC_NONE writeback during sys_sync and reorder sync passes
authorJan Kara <jack@suse.cz>
Tue, 3 Jul 2012 14:45:34 +0000 (16:45 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 22 Jul 2012 19:59:01 +0000 (23:59 +0400)
commit4ea425b63a3dfeb7707fc7cc7161c11a51e871ed
treef82060e43047424014436f88e808c3f1bba068f3
parentd0e91b13eb34d449922124c34f8a05e498daa089
vfs: Avoid unnecessary WB_SYNC_NONE writeback during sys_sync and reorder sync passes

wakeup_flusher_threads(0) will queue work doing complete writeback for each
flusher thread. Thus there is not much point in submitting another work doing
full inode WB_SYNC_NONE writeback by writeback_inodes_sb().

After this change it does not make sense to call nonblocking ->sync_fs and
block device flush before calling sync_inodes_sb() because
wakeup_flusher_threads() is completely asynchronous and thus these functions
would be called in parallel with inode writeback running which will effectively
void any work they do. So we move sync_inodes_sb() call before these two
functions.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/sync.c