From: Mike Galbraith Date: Fri, 8 Feb 2008 12:20:23 +0000 (-0800) Subject: write_inode_now(): avoid unnecessary synchronous write X-Git-Tag: v2.6.25-rc1~157 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=18914b1884ebdbcd4d4454100502a23d1d2dba43;p=linux-2.6-omap-h63xx.git write_inode_now(): avoid unnecessary synchronous write We shouldn't use WB_SYNC_ALL if the caller is asking for asynchronous treatment. Signed-off-by: Mike Galbraith Acked-by: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index db80ce9eb1d..c0076077d33 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -655,7 +655,7 @@ int write_inode_now(struct inode *inode, int sync) int ret; struct writeback_control wbc = { .nr_to_write = LONG_MAX, - .sync_mode = WB_SYNC_ALL, + .sync_mode = sync ? WB_SYNC_ALL : WB_SYNC_NONE, .range_start = 0, .range_end = LLONG_MAX, };