Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
[linux-2.6-microblaze.git] / mm / ksm.c
index 0662093..c20bd4d 100644 (file)
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -15,6 +15,7 @@
 
 #include <linux/errno.h>
 #include <linux/mm.h>
+#include <linux/mm_inline.h>
 #include <linux/fs.h>
 #include <linux/mman.h>
 #include <linux/sched.h>
@@ -2575,8 +2576,8 @@ struct page *ksm_might_need_to_copy(struct page *page,
                        return page;    /* no need to copy it */
        } else if (!anon_vma) {
                return page;            /* no need to copy it */
-       } else if (anon_vma->root == vma->anon_vma->root &&
-                page->index == linear_page_index(vma, address)) {
+       } else if (page->index == linear_page_index(vma, address) &&
+                       anon_vma->root == vma->anon_vma->root) {
                return page;            /* still no need to copy it */
        }
        if (!PageUptodate(page))