From: Mike Galbraith Date: Fri, 8 Feb 2008 12:20:23 +0000 (-0800) Subject: write_inode_now(): avoid unnecessary synchronous write X-Git-Tag: Ubuntu-snapdragon-4.4.0-1050.54~34741 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=18914b1884ebdbcd4d4454100502a23d1d2dba43;p=mirror_ubuntu-artful-kernel.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 db80ce9eb1d0..c0076077d338 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, };