Commit 875d91b1 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Linus Torvalds

mm/filemap.c: rewrite mapping_needs_writeback in less fancy manner

This actually checks that writeback is needed or in progress.

Link: http://lkml.kernel.org/r/156378817069.1087.1302816672037672488.stgit@buzzSigned-off-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c3aab9a0
...@@ -618,10 +618,13 @@ int filemap_fdatawait_keep_errors(struct address_space *mapping) ...@@ -618,10 +618,13 @@ int filemap_fdatawait_keep_errors(struct address_space *mapping)
} }
EXPORT_SYMBOL(filemap_fdatawait_keep_errors); EXPORT_SYMBOL(filemap_fdatawait_keep_errors);
/* Returns true if writeback might be needed or already in progress. */
static bool mapping_needs_writeback(struct address_space *mapping) static bool mapping_needs_writeback(struct address_space *mapping)
{ {
return (!dax_mapping(mapping) && mapping->nrpages) || if (dax_mapping(mapping))
(dax_mapping(mapping) && mapping->nrexceptional); return mapping->nrexceptional;
return mapping->nrpages;
} }
int filemap_write_and_wait(struct address_space *mapping) int filemap_write_and_wait(struct address_space *mapping)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment