aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm_inline.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mm_inline.h')
-rw-r--r--include/linux/mm_inline.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index 2704729777ef..96e970485b6c 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -1,3 +1,28 @@
1#ifndef LINUX_MM_INLINE_H
2#define LINUX_MM_INLINE_H
3
4/**
5 * page_is_file_cache - should the page be on a file LRU or anon LRU?
6 * @page: the page to test
7 *
8 * Returns !0 if @page is page cache page backed by a regular filesystem,
9 * or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed.
10 * Used by functions that manipulate the LRU lists, to sort a page
11 * onto the right LRU list.
12 *
13 * We would like to get this info without a page flag, but the state
14 * needs to survive until the page is last deleted from the LRU, which
15 * could be as far down as __page_cache_release.
16 */
17static inline int page_is_file_cache(struct page *page)
18{
19 if (PageSwapBacked(page))
20 return 0;
21
22 /* The page is page cache backed by a normal filesystem. */
23 return 1;
24}
25
1static inline void 26static inline void
2add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l) 27add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l)
3{ 28{
@@ -65,3 +90,5 @@ static inline enum lru_list page_lru(struct page *page)
65 90
66 return lru; 91 return lru;
67} 92}
93
94#endif