[Devel] [PATCH RH7 3/4] fs: Export mapping_needs_writeback()
Kirill Tkhai
ktkhai at virtuozzo.com
Thu Aug 6 14:55:39 MSK 2020
For next patch.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
include/linux/pagemap.h | 7 +++++++
mm/filemap.c | 6 ------
2 files changed, 7 insertions(+), 6 deletions(-)
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;
More information about the Devel
mailing list