Commit 50062175ffc844b8ff9664024c6416a37ad63c77

Authored by Al Viro
1 parent 777eda2c5b

vm_area_operations: kill ->migrate()

the only instance this method has ever grown was one in kernfs -
one that call ->migrate() of another vm_ops if it exists.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 5 changed files with 0 additions and 60 deletions Side-by-side Diff

... ... @@ -448,27 +448,6 @@
448 448 return pol;
449 449 }
450 450  
451   -static int kernfs_vma_migrate(struct vm_area_struct *vma,
452   - const nodemask_t *from, const nodemask_t *to,
453   - unsigned long flags)
454   -{
455   - struct file *file = vma->vm_file;
456   - struct kernfs_open_file *of = kernfs_of(file);
457   - int ret;
458   -
459   - if (!of->vm_ops)
460   - return 0;
461   -
462   - if (!kernfs_get_active(of->kn))
463   - return 0;
464   -
465   - ret = 0;
466   - if (of->vm_ops->migrate)
467   - ret = of->vm_ops->migrate(vma, from, to, flags);
468   -
469   - kernfs_put_active(of->kn);
470   - return ret;
471   -}
472 451 #endif
473 452  
474 453 static const struct vm_operations_struct kernfs_vm_ops = {
... ... @@ -479,7 +458,6 @@
479 458 #ifdef CONFIG_NUMA
480 459 .set_policy = kernfs_vma_set_policy,
481 460 .get_policy = kernfs_vma_get_policy,
482   - .migrate = kernfs_vma_migrate,
483 461 #endif
484 462 };
485 463  
include/linux/migrate.h
... ... @@ -36,9 +36,6 @@
36 36  
37 37 extern int migrate_prep(void);
38 38 extern int migrate_prep_local(void);
39   -extern int migrate_vmas(struct mm_struct *mm,
40   - const nodemask_t *from, const nodemask_t *to,
41   - unsigned long flags);
42 39 extern void migrate_page_copy(struct page *newpage, struct page *page);
43 40 extern int migrate_huge_page_move_mapping(struct address_space *mapping,
44 41 struct page *newpage, struct page *page);
... ... @@ -56,13 +53,6 @@
56 53  
57 54 static inline int migrate_prep(void) { return -ENOSYS; }
58 55 static inline int migrate_prep_local(void) { return -ENOSYS; }
59   -
60   -static inline int migrate_vmas(struct mm_struct *mm,
61   - const nodemask_t *from, const nodemask_t *to,
62   - unsigned long flags)
63   -{
64   - return -ENOSYS;
65   -}
66 56  
67 57 static inline void migrate_page_copy(struct page *newpage,
68 58 struct page *page) {}
... ... @@ -286,8 +286,6 @@
286 286 */
287 287 struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
288 288 unsigned long addr);
289   - int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from,
290   - const nodemask_t *to, unsigned long flags);
291 289 #endif
292 290 /* called by sys_remap_file_pages() to populate non-linear mapping */
293 291 int (*remap_pages)(struct vm_area_struct *vma, unsigned long addr,
... ... @@ -1047,10 +1047,6 @@
1047 1047  
1048 1048 down_read(&mm->mmap_sem);
1049 1049  
1050   - err = migrate_vmas(mm, from, to, flags);
1051   - if (err)
1052   - goto out;
1053   -
1054 1050 /*
1055 1051 * Find a 'source' bit set in 'tmp' whose corresponding 'dest'
1056 1052 * bit in 'to' is not also set in 'tmp'. Clear the found 'source'
... ... @@ -1130,7 +1126,6 @@
1130 1126 if (err < 0)
1131 1127 break;
1132 1128 }
1133   -out:
1134 1129 up_read(&mm->mmap_sem);
1135 1130 if (err < 0)
1136 1131 return err;
... ... @@ -1536,27 +1536,6 @@
1536 1536 return err;
1537 1537 }
1538 1538  
1539   -/*
1540   - * Call migration functions in the vma_ops that may prepare
1541   - * memory in a vm for migration. migration functions may perform
1542   - * the migration for vmas that do not have an underlying page struct.
1543   - */
1544   -int migrate_vmas(struct mm_struct *mm, const nodemask_t *to,
1545   - const nodemask_t *from, unsigned long flags)
1546   -{
1547   - struct vm_area_struct *vma;
1548   - int err = 0;
1549   -
1550   - for (vma = mm->mmap; vma && !err; vma = vma->vm_next) {
1551   - if (vma->vm_ops && vma->vm_ops->migrate) {
1552   - err = vma->vm_ops->migrate(vma, to, from, flags);
1553   - if (err)
1554   - break;
1555   - }
1556   - }
1557   - return err;
1558   -}
1559   -
1560 1539 #ifdef CONFIG_NUMA_BALANCING
1561 1540 /*
1562 1541 * Returns true if this is a safe migration target node for misplaced NUMA