aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 2c521defb41e..568152ae6caf 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -87,6 +87,7 @@
87#include <linux/migrate.h> 87#include <linux/migrate.h>
88#include <linux/rmap.h> 88#include <linux/rmap.h>
89#include <linux/security.h> 89#include <linux/security.h>
90#include <linux/syscalls.h>
90 91
91#include <asm/tlbflush.h> 92#include <asm/tlbflush.h>
92#include <asm/uaccess.h> 93#include <asm/uaccess.h>
@@ -108,6 +109,9 @@ struct mempolicy default_policy = {
108 .policy = MPOL_DEFAULT, 109 .policy = MPOL_DEFAULT,
109}; 110};
110 111
112static void mpol_rebind_policy(struct mempolicy *pol,
113 const nodemask_t *newmask);
114
111/* Do sanity checking on a policy */ 115/* Do sanity checking on a policy */
112static int mpol_check_policy(int mode, nodemask_t *nodes) 116static int mpol_check_policy(int mode, nodemask_t *nodes)
113{ 117{
@@ -459,7 +463,7 @@ static void mpol_set_task_struct_flag(void)
459} 463}
460 464
461/* Set the process memory policy */ 465/* Set the process memory policy */
462long do_set_mempolicy(int mode, nodemask_t *nodes) 466static long do_set_mempolicy(int mode, nodemask_t *nodes)
463{ 467{
464 struct mempolicy *new; 468 struct mempolicy *new;
465 469
@@ -519,8 +523,8 @@ static int lookup_node(struct mm_struct *mm, unsigned long addr)
519} 523}
520 524
521/* Retrieve NUMA policy */ 525/* Retrieve NUMA policy */
522long do_get_mempolicy(int *policy, nodemask_t *nmask, 526static long do_get_mempolicy(int *policy, nodemask_t *nmask,
523 unsigned long addr, unsigned long flags) 527 unsigned long addr, unsigned long flags)
524{ 528{
525 int err; 529 int err;
526 struct mm_struct *mm = current->mm; 530 struct mm_struct *mm = current->mm;
@@ -611,7 +615,8 @@ static struct page *new_node_page(struct page *page, unsigned long node, int **x
611 * Migrate pages from one node to a target node. 615 * Migrate pages from one node to a target node.
612 * Returns error or the number of pages not migrated. 616 * Returns error or the number of pages not migrated.
613 */ 617 */
614int migrate_to_node(struct mm_struct *mm, int source, int dest, int flags) 618static int migrate_to_node(struct mm_struct *mm, int source, int dest,
619 int flags)
615{ 620{
616 nodemask_t nmask; 621 nodemask_t nmask;
617 LIST_HEAD(pagelist); 622 LIST_HEAD(pagelist);
@@ -742,8 +747,9 @@ static struct page *new_vma_page(struct page *page, unsigned long private, int *
742} 747}
743#endif 748#endif
744 749
745long do_mbind(unsigned long start, unsigned long len, 750static long do_mbind(unsigned long start, unsigned long len,
746 unsigned long mode, nodemask_t *nmask, unsigned long flags) 751 unsigned long mode, nodemask_t *nmask,
752 unsigned long flags)
747{ 753{
748 struct vm_area_struct *vma; 754 struct vm_area_struct *vma;
749 struct mm_struct *mm = current->mm; 755 struct mm_struct *mm = current->mm;
@@ -988,7 +994,8 @@ asmlinkage long sys_get_mempolicy(int __user *policy,
988 unsigned long maxnode, 994 unsigned long maxnode,
989 unsigned long addr, unsigned long flags) 995 unsigned long addr, unsigned long flags)
990{ 996{
991 int err, pval; 997 int err;
998 int uninitialized_var(pval);
992 nodemask_t nodes; 999 nodemask_t nodes;
993 1000
994 if (nmask != NULL && maxnode < MAX_NUMNODES) 1001 if (nmask != NULL && maxnode < MAX_NUMNODES)
@@ -1537,8 +1544,8 @@ static void sp_delete(struct shared_policy *sp, struct sp_node *n)
1537 kmem_cache_free(sn_cache, n); 1544 kmem_cache_free(sn_cache, n);
1538} 1545}
1539 1546
1540struct sp_node * 1547static struct sp_node *sp_alloc(unsigned long start, unsigned long end,
1541sp_alloc(unsigned long start, unsigned long end, struct mempolicy *pol) 1548 struct mempolicy *pol)
1542{ 1549{
1543 struct sp_node *n = kmem_cache_alloc(sn_cache, GFP_KERNEL); 1550 struct sp_node *n = kmem_cache_alloc(sn_cache, GFP_KERNEL);
1544 1551
@@ -1716,7 +1723,8 @@ void numa_default_policy(void)
1716} 1723}
1717 1724
1718/* Migrate a policy to a different set of nodes */ 1725/* Migrate a policy to a different set of nodes */
1719void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *newmask) 1726static void mpol_rebind_policy(struct mempolicy *pol,
1727 const nodemask_t *newmask)
1720{ 1728{
1721 nodemask_t *mpolmask; 1729 nodemask_t *mpolmask;
1722 nodemask_t tmp; 1730 nodemask_t tmp;