aboutsummaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 1c2a71aa05cd..0576c0535988 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -976,3 +976,23 @@ out2:
976} 976}
977#endif 977#endif
978 978
979/*
980 * Call migration functions in the vma_ops that may prepare
981 * memory in a vm for migration. migration functions may perform
982 * the migration for vmas that do not have an underlying page struct.
983 */
984int migrate_vmas(struct mm_struct *mm, const nodemask_t *to,
985 const nodemask_t *from, unsigned long flags)
986{
987 struct vm_area_struct *vma;
988 int err = 0;
989
990 for(vma = mm->mmap; vma->vm_next && !err; vma = vma->vm_next) {
991 if (vma->vm_ops && vma->vm_ops->migrate) {
992 err = vma->vm_ops->migrate(vma, to, from, flags);
993 if (err)
994 break;
995 }
996 }
997 return err;
998}