mm/vmscan.c:__zone_reclaim(): replace max_t() with max()
[deliverable/linux.git] / mm / page-writeback.c
index 0713bfbf095410bbef16023ac9a97d36bfda9183..7300c9d5e1d999f9f68a17590f260de297ad9cbe 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/buffer_head.h> /* __set_page_dirty_buffers */
 #include <linux/pagevec.h>
 #include <linux/timer.h>
+#include <linux/sched/rt.h>
 #include <trace/events/writeback.h>
 
 /*
@@ -2289,3 +2290,27 @@ int mapping_tagged(struct address_space *mapping, int tag)
        return radix_tree_tagged(&mapping->page_tree, tag);
 }
 EXPORT_SYMBOL(mapping_tagged);
+
+/**
+ * wait_for_stable_page() - wait for writeback to finish, if necessary.
+ * @page:      The page to wait on.
+ *
+ * This function determines if the given page is related to a backing device
+ * that requires page contents to be held stable during writeback.  If so, then
+ * it will wait for any pending writeback to complete.
+ */
+void wait_for_stable_page(struct page *page)
+{
+       struct address_space *mapping = page_mapping(page);
+       struct backing_dev_info *bdi = mapping->backing_dev_info;
+
+       if (!bdi_cap_stable_pages_required(bdi))
+               return;
+#ifdef CONFIG_NEED_BOUNCE_POOL
+       if (mapping->host->i_sb->s_flags & MS_SNAP_STABLE)
+               return;
+#endif /* CONFIG_NEED_BOUNCE_POOL */
+
+       wait_on_page_writeback(page);
+}
+EXPORT_SYMBOL_GPL(wait_for_stable_page);
This page took 0.02472 seconds and 5 git commands to generate.