diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mm_inline.h | 22 | ||||
-rw-r--r-- | include/linux/swap.h | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 47762ca695a5..49cc68af01f8 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
@@ -38,3 +38,25 @@ del_page_from_lru(struct zone *zone, struct page *page) | |||
38 | zone->nr_inactive--; | 38 | zone->nr_inactive--; |
39 | } | 39 | } |
40 | } | 40 | } |
41 | |||
42 | /* | ||
43 | * Isolate one page from the LRU lists. | ||
44 | * | ||
45 | * - zone->lru_lock must be held | ||
46 | */ | ||
47 | static inline int __isolate_lru_page(struct page *page) | ||
48 | { | ||
49 | if (unlikely(!TestClearPageLRU(page))) | ||
50 | return 0; | ||
51 | |||
52 | if (get_page_testone(page)) { | ||
53 | /* | ||
54 | * It is being freed elsewhere | ||
55 | */ | ||
56 | __put_page(page); | ||
57 | SetPageLRU(page); | ||
58 | return -ENOENT; | ||
59 | } | ||
60 | |||
61 | return 1; | ||
62 | } | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index 556617bcf7ac..a49112536c02 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -175,6 +175,9 @@ extern int try_to_free_pages(struct zone **, gfp_t); | |||
175 | extern int shrink_all_memory(int); | 175 | extern int shrink_all_memory(int); |
176 | extern int vm_swappiness; | 176 | extern int vm_swappiness; |
177 | 177 | ||
178 | extern int isolate_lru_page(struct page *p); | ||
179 | extern int putback_lru_pages(struct list_head *l); | ||
180 | |||
178 | #ifdef CONFIG_MMU | 181 | #ifdef CONFIG_MMU |
179 | /* linux/mm/shmem.c */ | 182 | /* linux/mm/shmem.c */ |
180 | extern int shmem_unuse(swp_entry_t entry, struct page *page); | 183 | extern int shmem_unuse(swp_entry_t entry, struct page *page); |