diff options
Diffstat (limited to 'include/linux/ksm.h')
-rw-r--r-- | include/linux/ksm.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/ksm.h b/include/linux/ksm.h index a485c14ecd5d..1401a313fa77 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h | |||
@@ -38,7 +38,8 @@ static inline void ksm_exit(struct mm_struct *mm) | |||
38 | */ | 38 | */ |
39 | static inline int PageKsm(struct page *page) | 39 | static inline int PageKsm(struct page *page) |
40 | { | 40 | { |
41 | return ((unsigned long)page->mapping == PAGE_MAPPING_ANON); | 41 | return ((unsigned long)page->mapping & PAGE_MAPPING_FLAGS) == |
42 | (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM); | ||
42 | } | 43 | } |
43 | 44 | ||
44 | /* | 45 | /* |
@@ -47,7 +48,7 @@ static inline int PageKsm(struct page *page) | |||
47 | static inline void page_add_ksm_rmap(struct page *page) | 48 | static inline void page_add_ksm_rmap(struct page *page) |
48 | { | 49 | { |
49 | if (atomic_inc_and_test(&page->_mapcount)) { | 50 | if (atomic_inc_and_test(&page->_mapcount)) { |
50 | page->mapping = (void *) PAGE_MAPPING_ANON; | 51 | page->mapping = (void *) (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM); |
51 | __inc_zone_page_state(page, NR_ANON_PAGES); | 52 | __inc_zone_page_state(page, NR_ANON_PAGES); |
52 | } | 53 | } |
53 | } | 54 | } |