aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-05-15 05:06:42 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-12-17 08:26:51 -0500
commit50062175ffc844b8ff9664024c6416a37ad63c77 (patch)
treeacde5ad578854a34a31a97eea496cfd5e6e155ef
parent777eda2c5b84d6f3543f4aecbf4cd1f29b222a81 (diff)
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>
-rw-r--r--fs/kernfs/file.c22
-rw-r--r--include/linux/migrate.h10
-rw-r--r--include/linux/mm.h2
-rw-r--r--mm/mempolicy.c5
-rw-r--r--mm/migrate.c21
5 files changed, 0 insertions, 60 deletions
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
index 697390ea47b8..ddc9f9612f16 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -448,27 +448,6 @@ static struct mempolicy *kernfs_vma_get_policy(struct vm_area_struct *vma,
448 return pol; 448 return pol;
449} 449}
450 450
451static 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#endif 451#endif
473 452
474static const struct vm_operations_struct kernfs_vm_ops = { 453static const struct vm_operations_struct kernfs_vm_ops = {
@@ -479,7 +458,6 @@ static const struct vm_operations_struct kernfs_vm_ops = {
479#ifdef CONFIG_NUMA 458#ifdef CONFIG_NUMA
480 .set_policy = kernfs_vma_set_policy, 459 .set_policy = kernfs_vma_set_policy,
481 .get_policy = kernfs_vma_get_policy, 460 .get_policy = kernfs_vma_get_policy,
482 .migrate = kernfs_vma_migrate,
483#endif 461#endif
484}; 462};
485 463
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 01aad3ed89ec..fab9b32ace8e 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -36,9 +36,6 @@ extern int migrate_pages(struct list_head *l, new_page_t new, free_page_t free,
36 36
37extern int migrate_prep(void); 37extern int migrate_prep(void);
38extern int migrate_prep_local(void); 38extern int migrate_prep_local(void);
39extern int migrate_vmas(struct mm_struct *mm,
40 const nodemask_t *from, const nodemask_t *to,
41 unsigned long flags);
42extern void migrate_page_copy(struct page *newpage, struct page *page); 39extern void migrate_page_copy(struct page *newpage, struct page *page);
43extern int migrate_huge_page_move_mapping(struct address_space *mapping, 40extern int migrate_huge_page_move_mapping(struct address_space *mapping,
44 struct page *newpage, struct page *page); 41 struct page *newpage, struct page *page);
@@ -57,13 +54,6 @@ static inline int migrate_pages(struct list_head *l, new_page_t new,
57static inline int migrate_prep(void) { return -ENOSYS; } 54static inline int migrate_prep(void) { return -ENOSYS; }
58static inline int migrate_prep_local(void) { return -ENOSYS; } 55static inline int migrate_prep_local(void) { return -ENOSYS; }
59 56
60static 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
67static inline void migrate_page_copy(struct page *newpage, 57static inline void migrate_page_copy(struct page *newpage,
68 struct page *page) {} 58 struct page *page) {}
69 59
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c0a67b894c4c..f80d0194c9bc 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -286,8 +286,6 @@ struct vm_operations_struct {
286 */ 286 */
287 struct mempolicy *(*get_policy)(struct vm_area_struct *vma, 287 struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
288 unsigned long addr); 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#endif 289#endif
292 /* called by sys_remap_file_pages() to populate non-linear mapping */ 290 /* called by sys_remap_file_pages() to populate non-linear mapping */
293 int (*remap_pages)(struct vm_area_struct *vma, unsigned long addr, 291 int (*remap_pages)(struct vm_area_struct *vma, unsigned long addr,
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index e58725aff7e9..c1b273f1837b 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1047,10 +1047,6 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
1047 1047
1048 down_read(&mm->mmap_sem); 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 * Find a 'source' bit set in 'tmp' whose corresponding 'dest' 1051 * Find a 'source' bit set in 'tmp' whose corresponding 'dest'
1056 * bit in 'to' is not also set in 'tmp'. Clear the found 'source' 1052 * bit in 'to' is not also set in 'tmp'. Clear the found 'source'
@@ -1130,7 +1126,6 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
1130 if (err < 0) 1126 if (err < 0)
1131 break; 1127 break;
1132 } 1128 }
1133out:
1134 up_read(&mm->mmap_sem); 1129 up_read(&mm->mmap_sem);
1135 if (err < 0) 1130 if (err < 0)
1136 return err; 1131 return err;
diff --git a/mm/migrate.c b/mm/migrate.c
index b1d02127e1be..344cdf692fc8 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1536,27 +1536,6 @@ out:
1536 return err; 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 */
1544int 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#ifdef CONFIG_NUMA_BALANCING 1539#ifdef CONFIG_NUMA_BALANCING
1561/* 1540/*
1562 * Returns true if this is a safe migration target node for misplaced NUMA 1541 * Returns true if this is a safe migration target node for misplaced NUMA