aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2013-09-11 17:20:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:57:00 -0400
commitef0855d334e1e4af7c3e0c42146a8479ea14a5ab (patch)
tree5955b0424bb392e1949acc0ad5066cb461bef867 /include
parentc07303c0af38ffb1e5fd9b5ff37d0798298a7acf (diff)
mm: mempolicy: turn vma_set_policy() into vma_dup_policy()
Simple cleanup. Every user of vma_set_policy() does the same work, this looks a bit annoying imho. And the new trivial helper which does mpol_dup() + vma_set_policy() to simplify the callers. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Rik van Riel <riel@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mempolicy.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 0d7df39a5885..b2f897789838 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -91,7 +91,6 @@ static inline struct mempolicy *mpol_dup(struct mempolicy *pol)
91} 91}
92 92
93#define vma_policy(vma) ((vma)->vm_policy) 93#define vma_policy(vma) ((vma)->vm_policy)
94#define vma_set_policy(vma, pol) ((vma)->vm_policy = (pol))
95 94
96static inline void mpol_get(struct mempolicy *pol) 95static inline void mpol_get(struct mempolicy *pol)
97{ 96{
@@ -126,6 +125,7 @@ struct shared_policy {
126 spinlock_t lock; 125 spinlock_t lock;
127}; 126};
128 127
128int vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst);
129void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol); 129void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol);
130int mpol_set_shared_policy(struct shared_policy *info, 130int mpol_set_shared_policy(struct shared_policy *info,
131 struct vm_area_struct *vma, 131 struct vm_area_struct *vma,
@@ -240,7 +240,12 @@ mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx)
240} 240}
241 241
242#define vma_policy(vma) NULL 242#define vma_policy(vma) NULL
243#define vma_set_policy(vma, pol) do {} while(0) 243
244static inline int
245vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst)
246{
247 return 0;
248}
244 249
245static inline void numa_policy_init(void) 250static inline void numa_policy_init(void)
246{ 251{