aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2007-10-16 04:26:26 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:03 -0400
commitdbcb0f19c877df9026b8c1227758d38bd561e9c4 (patch)
treef58c85976906f42ff44798f514177392d7c48d0f
parentd8dc74f212c38407fc9f4367181f8f969b719485 (diff)
mm/mempolicy.c: cleanups
This patch contains the following cleanups: - every file should include the headers containing the prototypes for its global functions - make the follosing needlessly global functions static: - migrate_to_node() - do_mbind() - sp_alloc() - mpol_rebind_policy() [akpm@linux-foundation.org: fix uninitialised var warning] Signed-off-by: Adrian Bunk <bunk@stusta.de> Acked-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/mempolicy.h6
-rw-r--r--mm/mempolicy.c28
2 files changed, 18 insertions, 16 deletions
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 7e9698ec839b..38c04d61ee06 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -144,7 +144,6 @@ struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp,
144 144
145extern void numa_default_policy(void); 145extern void numa_default_policy(void);
146extern void numa_policy_init(void); 146extern void numa_policy_init(void);
147extern void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *new);
148extern void mpol_rebind_task(struct task_struct *tsk, 147extern void mpol_rebind_task(struct task_struct *tsk,
149 const nodemask_t *new); 148 const nodemask_t *new);
150extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); 149extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new);
@@ -236,11 +235,6 @@ static inline void numa_default_policy(void)
236{ 235{
237} 236}
238 237
239static inline void mpol_rebind_policy(struct mempolicy *pol,
240 const nodemask_t *new)
241{
242}
243
244static inline void mpol_rebind_task(struct task_struct *tsk, 238static inline void mpol_rebind_task(struct task_struct *tsk,
245 const nodemask_t *new) 239 const nodemask_t *new)
246{ 240{
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;