Merge tag 'ceph-for-5.4-rc1' of git://github.com/ceph/ceph-client
[linux-2.6-block.git] / mm / mempolicy.c
index 65e0874fce1736a65f8ced74f2a94d3e23d718c9..464406e8da9109b63d705132c3ea5f2187dd8c2e 100644 (file)
@@ -68,7 +68,7 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/mempolicy.h>
-#include <linux/mm.h>
+#include <linux/pagewalk.h>
 #include <linux/highmem.h>
 #include <linux/hugetlb.h>
 #include <linux/kernel.h>
@@ -655,6 +655,12 @@ static int queue_pages_test_walk(unsigned long start, unsigned long end,
        return 1;
 }
 
+static const struct mm_walk_ops queue_pages_walk_ops = {
+       .hugetlb_entry          = queue_pages_hugetlb,
+       .pmd_entry              = queue_pages_pte_range,
+       .test_walk              = queue_pages_test_walk,
+};
+
 /*
  * Walk through page tables and collect pages to be migrated.
  *
@@ -679,15 +685,8 @@ queue_pages_range(struct mm_struct *mm, unsigned long start, unsigned long end,
                .nmask = nodes,
                .prev = NULL,
        };
-       struct mm_walk queue_pages_walk = {
-               .hugetlb_entry = queue_pages_hugetlb,
-               .pmd_entry = queue_pages_pte_range,
-               .test_walk = queue_pages_test_walk,
-               .mm = mm,
-               .private = &qp,
-       };
 
-       return walk_page_range(start, end, &queue_pages_walk);
+       return walk_page_range(mm, start, end, &queue_pages_walk_ops, &qp);
 }
 
 /*
@@ -1513,10 +1512,6 @@ static int kernel_migrate_pages(pid_t pid, unsigned long maxnode,
        if (nodes_empty(*new))
                goto out_put;
 
-       nodes_and(*new, *new, node_states[N_MEMORY]);
-       if (nodes_empty(*new))
-               goto out_put;
-
        err = security_task_movememory(task);
        if (err)
                goto out_put;