Skip to content

Commit

Permalink
write_inode_now(): avoid unnecessary synchronous write
Browse files Browse the repository at this point in the history
We shouldn't use WB_SYNC_ALL if the caller is asking for asynchronous
treatment.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Mike Galbraith authored and Linus Torvalds committed Feb 8, 2008
1 parent abe8be3 commit 18914b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down

0 comments on commit 18914b1

Please sign in to comment.