From: Nick Piggin <npiggin@suse.de>
References: FATE309111
Subject: uninline add_to_page_cache
Patch-mainline: no, [js] has no idea
11sp3->sle12 porting remarks by mhocko@suse.cz:
add_to_page_cache has to stay in mm/filemap.c otherwise we would need
to export also other pagecache limit related symbols.
Original changelog:
Uninline add_to_page_cache so that we can add to the function in a
subsequent patch (pagecache limiting) without changing the kABI.
Signed-off-by: Nick Piggin <npiggin@suse.de>
--
---
include/linux/pagemap.h | 18 ++----------------
mm/filemap.c | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 16 deletions(-)
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -653,6 +653,8 @@ static inline int fault_in_multipages_re
return 0;
}
+int add_to_page_cache(struct page *page, struct address_space *mapping,
+ pgoff_t index, gfp_t gfp_mask);
int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
pgoff_t index, gfp_t gfp_mask);
int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
@@ -662,22 +664,6 @@ extern void __delete_from_page_cache(str
struct mem_cgroup *memcg);
int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask);
-/*
- * Like add_to_page_cache_locked, but used to add newly allocated pages:
- * the page is new, so we can just run __set_page_locked() against it.
- */
-static inline int add_to_page_cache(struct page *page,
- struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask)
-{
- int error;
-
- __set_page_locked(page);
- error = add_to_page_cache_locked(page, mapping, offset, gfp_mask);
- if (unlikely(error))
- __clear_page_locked(page);
- return error;
-}
-
static inline unsigned long dir_pages(struct inode *inode)
{
return (unsigned long)(inode->i_size + PAGE_CACHE_SIZE - 1) >>
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -676,6 +676,23 @@ int add_to_page_cache_locked(struct page
}
EXPORT_SYMBOL(add_to_page_cache_locked);
+/*
+ * Like add_to_page_cache_locked, but used to add newly allocated pages:
+ * the page is new, so we can just run __set_page_locked() against it.
+ */
+int add_to_page_cache(struct page *page,
+ struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask)
+{
+ int error;
+
+ __set_page_locked(page);
+ error = add_to_page_cache_locked(page, mapping, offset, gfp_mask);
+ if (unlikely(error))
+ __clear_page_locked(page);
+ return error;
+}
+EXPORT_SYMBOL(add_to_page_cache);
+
int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
pgoff_t offset, gfp_t gfp_mask)
{