diff options
Diffstat (limited to 'include/linux/rmap.h')
-rw-r--r-- | include/linux/rmap.h | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index fed6f5e0b41..89f0564b10c 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -39,18 +39,6 @@ struct anon_vma { | |||
39 | 39 | ||
40 | #ifdef CONFIG_MMU | 40 | #ifdef CONFIG_MMU |
41 | 41 | ||
42 | extern struct kmem_cache *anon_vma_cachep; | ||
43 | |||
44 | static inline struct anon_vma *anon_vma_alloc(void) | ||
45 | { | ||
46 | return kmem_cache_alloc(anon_vma_cachep, GFP_KERNEL); | ||
47 | } | ||
48 | |||
49 | static inline void anon_vma_free(struct anon_vma *anon_vma) | ||
50 | { | ||
51 | kmem_cache_free(anon_vma_cachep, anon_vma); | ||
52 | } | ||
53 | |||
54 | static inline void anon_vma_lock(struct vm_area_struct *vma) | 42 | static inline void anon_vma_lock(struct vm_area_struct *vma) |
55 | { | 43 | { |
56 | struct anon_vma *anon_vma = vma->anon_vma; | 44 | struct anon_vma *anon_vma = vma->anon_vma; |
@@ -75,6 +63,9 @@ void anon_vma_unlink(struct vm_area_struct *); | |||
75 | void anon_vma_link(struct vm_area_struct *); | 63 | void anon_vma_link(struct vm_area_struct *); |
76 | void __anon_vma_link(struct vm_area_struct *); | 64 | void __anon_vma_link(struct vm_area_struct *); |
77 | 65 | ||
66 | extern struct anon_vma *page_lock_anon_vma(struct page *page); | ||
67 | extern void page_unlock_anon_vma(struct anon_vma *anon_vma); | ||
68 | |||
78 | /* | 69 | /* |
79 | * rmap interfaces called when adding or removing pte of page | 70 | * rmap interfaces called when adding or removing pte of page |
80 | */ | 71 | */ |
@@ -117,6 +108,19 @@ unsigned long page_address_in_vma(struct page *, struct vm_area_struct *); | |||
117 | */ | 108 | */ |
118 | int page_mkclean(struct page *); | 109 | int page_mkclean(struct page *); |
119 | 110 | ||
111 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
112 | /* | ||
113 | * called in munlock()/munmap() path to check for other vmas holding | ||
114 | * the page mlocked. | ||
115 | */ | ||
116 | int try_to_munlock(struct page *); | ||
117 | #else | ||
118 | static inline int try_to_munlock(struct page *page) | ||
119 | { | ||
120 | return 0; /* a.k.a. SWAP_SUCCESS */ | ||
121 | } | ||
122 | #endif | ||
123 | |||
120 | #else /* !CONFIG_MMU */ | 124 | #else /* !CONFIG_MMU */ |
121 | 125 | ||
122 | #define anon_vma_init() do {} while (0) | 126 | #define anon_vma_init() do {} while (0) |
@@ -140,5 +144,6 @@ static inline int page_mkclean(struct page *page) | |||
140 | #define SWAP_SUCCESS 0 | 144 | #define SWAP_SUCCESS 0 |
141 | #define SWAP_AGAIN 1 | 145 | #define SWAP_AGAIN 1 |
142 | #define SWAP_FAIL 2 | 146 | #define SWAP_FAIL 2 |
147 | #define SWAP_MLOCK 3 | ||
143 | 148 | ||
144 | #endif /* _LINUX_RMAP_H */ | 149 | #endif /* _LINUX_RMAP_H */ |