提交 2329d375 编写于 作者: J Jianyu Zhan 提交者: Linus Torvalds

mm/swap.c: clean up *lru_cache_add* functions

In mm/swap.c, __lru_cache_add() is exported, but actually there are no
users outside this file.

This patch unexports __lru_cache_add(), and makes it static.  It also
exports lru_cache_add_file(), as it is use by cifs and fuse, which can
loaded as modules.
Signed-off-by: NJianyu Zhan <nasa4836@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Shaohua Li <shli@kernel.org>
Cc: Bob Liu <bob.liu@oracle.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Rafael Aquini <aquini@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Acked-by: NRik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Khalid Aziz <khalid.aziz@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Reviewed-by: NZhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 cbe97414
...@@ -308,8 +308,9 @@ extern unsigned long nr_free_pagecache_pages(void); ...@@ -308,8 +308,9 @@ extern unsigned long nr_free_pagecache_pages(void);
/* linux/mm/swap.c */ /* linux/mm/swap.c */
extern void __lru_cache_add(struct page *);
extern void lru_cache_add(struct page *); extern void lru_cache_add(struct page *);
extern void lru_cache_add_anon(struct page *page);
extern void lru_cache_add_file(struct page *page);
extern void lru_add_page_tail(struct page *page, struct page *page_tail, extern void lru_add_page_tail(struct page *page, struct page *page_tail,
struct lruvec *lruvec, struct list_head *head); struct lruvec *lruvec, struct list_head *head);
extern void activate_page(struct page *); extern void activate_page(struct page *);
...@@ -323,22 +324,6 @@ extern void swap_setup(void); ...@@ -323,22 +324,6 @@ extern void swap_setup(void);
extern void add_page_to_unevictable_list(struct page *page); extern void add_page_to_unevictable_list(struct page *page);
/**
* lru_cache_add: add a page to the page lists
* @page: the page to add
*/
static inline void lru_cache_add_anon(struct page *page)
{
ClearPageActive(page);
__lru_cache_add(page);
}
static inline void lru_cache_add_file(struct page *page)
{
ClearPageActive(page);
__lru_cache_add(page);
}
/* linux/mm/vmscan.c */ /* linux/mm/vmscan.c */
extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
gfp_t gfp_mask, nodemask_t *mask); gfp_t gfp_mask, nodemask_t *mask);
......
...@@ -582,13 +582,7 @@ void mark_page_accessed(struct page *page) ...@@ -582,13 +582,7 @@ void mark_page_accessed(struct page *page)
} }
EXPORT_SYMBOL(mark_page_accessed); EXPORT_SYMBOL(mark_page_accessed);
/* static void __lru_cache_add(struct page *page)
* Queue the page for addition to the LRU via pagevec. The decision on whether
* to add the page to the [in]active [file|anon] list is deferred until the
* pagevec is drained. This gives a chance for the caller of __lru_cache_add()
* have the page added to the active list using mark_page_accessed().
*/
void __lru_cache_add(struct page *page)
{ {
struct pagevec *pvec = &get_cpu_var(lru_add_pvec); struct pagevec *pvec = &get_cpu_var(lru_add_pvec);
...@@ -598,11 +592,32 @@ void __lru_cache_add(struct page *page) ...@@ -598,11 +592,32 @@ void __lru_cache_add(struct page *page)
pagevec_add(pvec, page); pagevec_add(pvec, page);
put_cpu_var(lru_add_pvec); put_cpu_var(lru_add_pvec);
} }
EXPORT_SYMBOL(__lru_cache_add);
/**
* lru_cache_add: add a page to the page lists
* @page: the page to add
*/
void lru_cache_add_anon(struct page *page)
{
ClearPageActive(page);
__lru_cache_add(page);
}
void lru_cache_add_file(struct page *page)
{
ClearPageActive(page);
__lru_cache_add(page);
}
EXPORT_SYMBOL(lru_cache_add_file);
/** /**
* lru_cache_add - add a page to a page list * lru_cache_add - add a page to a page list
* @page: the page to be added to the LRU. * @page: the page to be added to the LRU.
*
* Queue the page for addition to the LRU via pagevec. The decision on whether
* to add the page to the [in]active [file|anon] list is deferred until the
* pagevec is drained. This gives a chance for the caller of lru_cache_add()
* have the page added to the active list using mark_page_accessed().
*/ */
void lru_cache_add(struct page *page) void lru_cache_add(struct page *page)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册