[RH7,3/4] fs: Export mapping_needs_writeback()

Submitted by Kirill Tkhai on Aug. 6, 2020, 11:55 a.m.

Details

Message ID 159671493718.36238.14195546424418589895.stgit@localhost.localdomain
State New
Series "ploop: Protect fastmap against defrag and punch hole"
Headers show

Commit Message

Kirill Tkhai Aug. 6, 2020, 11:55 a.m.
For next patch.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 include/linux/pagemap.h |    7 +++++++
 mm/filemap.c            |    6 ------
 2 files changed, 7 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 830eb58cf323..22c744016a39 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -14,6 +14,7 @@ 
 #include <linux/bitops.h>
 #include <linux/hardirq.h> /* for in_interrupt() */
 #include <linux/hugetlb_inline.h>
+#include <linux/dax.h>
 
 /*
  * Bits in mapping->flags.  The lower __GFP_BITS_SHIFT bits are the page
@@ -117,6 +118,12 @@  static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask)
 				(__force unsigned long)mask;
 }
 
+static inline bool mapping_needs_writeback(struct address_space *mapping)
+{
+	return (!dax_mapping(mapping) && mapping->nrpages) ||
+	    (dax_mapping(mapping) && mapping->nrexceptional);
+}
+
 /*
  * The page cache can done in larger chunks than
  * one page, because it allows for more efficient
diff --git a/mm/filemap.c b/mm/filemap.c
index 0346d6027eab..53db13f236da 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -499,12 +499,6 @@  int filemap_fdatawait_keep_errors(struct address_space *mapping)
 }
 EXPORT_SYMBOL(filemap_fdatawait_keep_errors);
 
-static bool mapping_needs_writeback(struct address_space *mapping)
-{
-	return (!dax_mapping(mapping) && mapping->nrpages) ||
-	    (dax_mapping(mapping) && mapping->nrexceptional);
-}
-
 int filemap_write_and_wait(struct address_space *mapping)
 {
 	int err = 0;