diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/rmap.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index d25bd224d370..567d43f29a10 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -29,6 +29,9 @@ struct anon_vma { | |||
29 | #ifdef CONFIG_KSM | 29 | #ifdef CONFIG_KSM |
30 | atomic_t ksm_refcount; | 30 | atomic_t ksm_refcount; |
31 | #endif | 31 | #endif |
32 | #ifdef CONFIG_MIGRATION | ||
33 | atomic_t migrate_refcount; | ||
34 | #endif | ||
32 | /* | 35 | /* |
33 | * NOTE: the LSB of the head.next is set by | 36 | * NOTE: the LSB of the head.next is set by |
34 | * mm_take_all_locks() _after_ taking the above lock. So the | 37 | * mm_take_all_locks() _after_ taking the above lock. So the |
@@ -81,6 +84,26 @@ static inline int ksm_refcount(struct anon_vma *anon_vma) | |||
81 | return 0; | 84 | return 0; |
82 | } | 85 | } |
83 | #endif /* CONFIG_KSM */ | 86 | #endif /* CONFIG_KSM */ |
87 | #ifdef CONFIG_MIGRATION | ||
88 | static inline void migrate_refcount_init(struct anon_vma *anon_vma) | ||
89 | { | ||
90 | atomic_set(&anon_vma->migrate_refcount, 0); | ||
91 | } | ||
92 | |||
93 | static inline int migrate_refcount(struct anon_vma *anon_vma) | ||
94 | { | ||
95 | return atomic_read(&anon_vma->migrate_refcount); | ||
96 | } | ||
97 | #else | ||
98 | static inline void migrate_refcount_init(struct anon_vma *anon_vma) | ||
99 | { | ||
100 | } | ||
101 | |||
102 | static inline int migrate_refcount(struct anon_vma *anon_vma) | ||
103 | { | ||
104 | return 0; | ||
105 | } | ||
106 | #endif /* CONFIG_MIGRATE */ | ||
84 | 107 | ||
85 | static inline struct anon_vma *page_anon_vma(struct page *page) | 108 | static inline struct anon_vma *page_anon_vma(struct page *page) |
86 | { | 109 | { |