diff options
Diffstat (limited to 'include/linux/rmap.h')
| -rw-r--r-- | include/linux/rmap.h | 30 | 
1 files changed, 27 insertions, 3 deletions
| diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 31b2fd75dcba..bb83c0da2071 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -25,8 +25,8 @@ | |||
| 25 | * pointing to this anon_vma once its vma list is empty. | 25 | * pointing to this anon_vma once its vma list is empty. | 
| 26 | */ | 26 | */ | 
| 27 | struct anon_vma { | 27 | struct anon_vma { | 
| 28 | spinlock_t lock; /* Serialize access to vma list */ | ||
| 29 | struct anon_vma *root; /* Root of this anon_vma tree */ | 28 | struct anon_vma *root; /* Root of this anon_vma tree */ | 
| 29 | spinlock_t lock; /* Serialize access to vma list */ | ||
| 30 | #if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION) | 30 | #if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION) | 
| 31 | 31 | ||
| 32 | /* | 32 | /* | 
| @@ -205,9 +205,20 @@ int try_to_unmap_one(struct page *, struct vm_area_struct *, | |||
| 205 | /* | 205 | /* | 
| 206 | * Called from mm/filemap_xip.c to unmap empty zero page | 206 | * Called from mm/filemap_xip.c to unmap empty zero page | 
| 207 | */ | 207 | */ | 
| 208 | pte_t *page_check_address(struct page *, struct mm_struct *, | 208 | pte_t *__page_check_address(struct page *, struct mm_struct *, | 
| 209 | unsigned long, spinlock_t **, int); | 209 | unsigned long, spinlock_t **, int); | 
| 210 | 210 | ||
| 211 | static inline pte_t *page_check_address(struct page *page, struct mm_struct *mm, | ||
| 212 | unsigned long address, | ||
| 213 | spinlock_t **ptlp, int sync) | ||
| 214 | { | ||
| 215 | pte_t *ptep; | ||
| 216 | |||
| 217 | __cond_lock(*ptlp, ptep = __page_check_address(page, mm, address, | ||
| 218 | ptlp, sync)); | ||
| 219 | return ptep; | ||
| 220 | } | ||
| 221 | |||
| 211 | /* | 222 | /* | 
| 212 | * Used by swapoff to help locate where page is expected in vma. | 223 | * Used by swapoff to help locate where page is expected in vma. | 
| 213 | */ | 224 | */ | 
| @@ -230,7 +241,20 @@ int try_to_munlock(struct page *); | |||
| 230 | /* | 241 | /* | 
| 231 | * Called by memory-failure.c to kill processes. | 242 | * Called by memory-failure.c to kill processes. | 
| 232 | */ | 243 | */ | 
| 233 | struct anon_vma *page_lock_anon_vma(struct page *page); | 244 | struct anon_vma *__page_lock_anon_vma(struct page *page); | 
| 245 | |||
| 246 | static inline struct anon_vma *page_lock_anon_vma(struct page *page) | ||
| 247 | { | ||
| 248 | struct anon_vma *anon_vma; | ||
| 249 | |||
| 250 | __cond_lock(RCU, anon_vma = __page_lock_anon_vma(page)); | ||
| 251 | |||
| 252 | /* (void) is needed to make gcc happy */ | ||
| 253 | (void) __cond_lock(&anon_vma->root->lock, anon_vma); | ||
| 254 | |||
| 255 | return anon_vma; | ||
| 256 | } | ||
| 257 | |||
| 234 | void page_unlock_anon_vma(struct anon_vma *anon_vma); | 258 | void page_unlock_anon_vma(struct anon_vma *anon_vma); | 
| 235 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | 259 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | 
| 236 | 260 | ||
