aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page-writeback.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r--mm/page-writeback.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 66a0024becd9..7300c9d5e1d9 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -2290,3 +2290,27 @@ int mapping_tagged(struct address_space *mapping, int tag)
2290 return radix_tree_tagged(&mapping->page_tree, tag); 2290 return radix_tree_tagged(&mapping->page_tree, tag);
2291} 2291}
2292EXPORT_SYMBOL(mapping_tagged); 2292EXPORT_SYMBOL(mapping_tagged);
2293
2294/**
2295 * wait_for_stable_page() - wait for writeback to finish, if necessary.
2296 * @page: The page to wait on.
2297 *
2298 * This function determines if the given page is related to a backing device
2299 * that requires page contents to be held stable during writeback. If so, then
2300 * it will wait for any pending writeback to complete.
2301 */
2302void wait_for_stable_page(struct page *page)
2303{
2304 struct address_space *mapping = page_mapping(page);
2305 struct backing_dev_info *bdi = mapping->backing_dev_info;
2306
2307 if (!bdi_cap_stable_pages_required(bdi))
2308 return;
2309#ifdef CONFIG_NEED_BOUNCE_POOL
2310 if (mapping->host->i_sb->s_flags & MS_SNAP_STABLE)
2311 return;
2312#endif /* CONFIG_NEED_BOUNCE_POOL */
2313
2314 wait_on_page_writeback(page);
2315}
2316EXPORT_SYMBOL_GPL(wait_for_stable_page);