You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Linus Torvalds
parent
c07303c0af
commit
ef0855d334
@@ -2065,6 +2065,16 @@ retry_cpuset:
|
||||
}
|
||||
EXPORT_SYMBOL(alloc_pages_current);
|
||||
|
||||
int vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst)
|
||||
{
|
||||
struct mempolicy *pol = mpol_dup(vma_policy(src));
|
||||
|
||||
if (IS_ERR(pol))
|
||||
return PTR_ERR(pol);
|
||||
dst->vm_policy = pol;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* If mpol_dup() sees current->cpuset == cpuset_being_rebound, then it
|
||||
* rebinds the mempolicy its copying by calling mpol_rebind_policy()
|
||||
|
||||
Reference in New Issue
Block a user