Commit dbcb0f19 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

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: default avatarAdrian Bunk <bunk@stusta.de>
Acked-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d8dc74f2
...@@ -144,7 +144,6 @@ struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, ...@@ -144,7 +144,6 @@ struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp,
extern void numa_default_policy(void); extern void numa_default_policy(void);
extern void numa_policy_init(void); extern void numa_policy_init(void);
extern void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *new);
extern void mpol_rebind_task(struct task_struct *tsk, extern void mpol_rebind_task(struct task_struct *tsk,
const nodemask_t *new); const nodemask_t *new);
extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new);
...@@ -236,11 +235,6 @@ static inline void numa_default_policy(void) ...@@ -236,11 +235,6 @@ static inline void numa_default_policy(void)
{ {
} }
static inline void mpol_rebind_policy(struct mempolicy *pol,
const nodemask_t *new)
{
}
static inline void mpol_rebind_task(struct task_struct *tsk, static inline void mpol_rebind_task(struct task_struct *tsk,
const nodemask_t *new) const nodemask_t *new)
{ {
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
#include <linux/migrate.h> #include <linux/migrate.h>
#include <linux/rmap.h> #include <linux/rmap.h>
#include <linux/security.h> #include <linux/security.h>
#include <linux/syscalls.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -108,6 +109,9 @@ struct mempolicy default_policy = { ...@@ -108,6 +109,9 @@ struct mempolicy default_policy = {
.policy = MPOL_DEFAULT, .policy = MPOL_DEFAULT,
}; };
static void mpol_rebind_policy(struct mempolicy *pol,
const nodemask_t *newmask);
/* Do sanity checking on a policy */ /* Do sanity checking on a policy */
static int mpol_check_policy(int mode, nodemask_t *nodes) static int mpol_check_policy(int mode, nodemask_t *nodes)
{ {
...@@ -459,7 +463,7 @@ static void mpol_set_task_struct_flag(void) ...@@ -459,7 +463,7 @@ static void mpol_set_task_struct_flag(void)
} }
/* Set the process memory policy */ /* Set the process memory policy */
long do_set_mempolicy(int mode, nodemask_t *nodes) static long do_set_mempolicy(int mode, nodemask_t *nodes)
{ {
struct mempolicy *new; struct mempolicy *new;
...@@ -519,8 +523,8 @@ static int lookup_node(struct mm_struct *mm, unsigned long addr) ...@@ -519,8 +523,8 @@ static int lookup_node(struct mm_struct *mm, unsigned long addr)
} }
/* Retrieve NUMA policy */ /* Retrieve NUMA policy */
long do_get_mempolicy(int *policy, nodemask_t *nmask, static long do_get_mempolicy(int *policy, nodemask_t *nmask,
unsigned long addr, unsigned long flags) unsigned long addr, unsigned long flags)
{ {
int err; int err;
struct mm_struct *mm = current->mm; 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,7 +615,8 @@ static struct page *new_node_page(struct page *page, unsigned long node, int **x
* Migrate pages from one node to a target node. * Migrate pages from one node to a target node.
* Returns error or the number of pages not migrated. * Returns error or the number of pages not migrated.
*/ */
int migrate_to_node(struct mm_struct *mm, int source, int dest, int flags) static int migrate_to_node(struct mm_struct *mm, int source, int dest,
int flags)
{ {
nodemask_t nmask; nodemask_t nmask;
LIST_HEAD(pagelist); LIST_HEAD(pagelist);
...@@ -742,8 +747,9 @@ static struct page *new_vma_page(struct page *page, unsigned long private, int * ...@@ -742,8 +747,9 @@ static struct page *new_vma_page(struct page *page, unsigned long private, int *
} }
#endif #endif
long do_mbind(unsigned long start, unsigned long len, static long do_mbind(unsigned long start, unsigned long len,
unsigned long mode, nodemask_t *nmask, unsigned long flags) unsigned long mode, nodemask_t *nmask,
unsigned long flags)
{ {
struct vm_area_struct *vma; struct vm_area_struct *vma;
struct mm_struct *mm = current->mm; struct mm_struct *mm = current->mm;
...@@ -988,7 +994,8 @@ asmlinkage long sys_get_mempolicy(int __user *policy, ...@@ -988,7 +994,8 @@ asmlinkage long sys_get_mempolicy(int __user *policy,
unsigned long maxnode, unsigned long maxnode,
unsigned long addr, unsigned long flags) unsigned long addr, unsigned long flags)
{ {
int err, pval; int err;
int uninitialized_var(pval);
nodemask_t nodes; nodemask_t nodes;
if (nmask != NULL && maxnode < MAX_NUMNODES) if (nmask != NULL && maxnode < MAX_NUMNODES)
...@@ -1537,8 +1544,8 @@ static void sp_delete(struct shared_policy *sp, struct sp_node *n) ...@@ -1537,8 +1544,8 @@ static void sp_delete(struct shared_policy *sp, struct sp_node *n)
kmem_cache_free(sn_cache, n); kmem_cache_free(sn_cache, n);
} }
struct sp_node * static struct sp_node *sp_alloc(unsigned long start, unsigned long end,
sp_alloc(unsigned long start, unsigned long end, struct mempolicy *pol) struct mempolicy *pol)
{ {
struct sp_node *n = kmem_cache_alloc(sn_cache, GFP_KERNEL); struct sp_node *n = kmem_cache_alloc(sn_cache, GFP_KERNEL);
...@@ -1716,7 +1723,8 @@ void numa_default_policy(void) ...@@ -1716,7 +1723,8 @@ void numa_default_policy(void)
} }
/* Migrate a policy to a different set of nodes */ /* Migrate a policy to a different set of nodes */
void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *newmask) static void mpol_rebind_policy(struct mempolicy *pol,
const nodemask_t *newmask)
{ {
nodemask_t *mpolmask; nodemask_t *mpolmask;
nodemask_t tmp; nodemask_t tmp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment