From: David Rientjes Date: Fri, 9 Nov 2012 03:04:29 +0000 (+1100) Subject: mm, mempolicy: remove duplicate code X-Git-Tag: next-20121112~5^2~159 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=57abde6bdb517f31a56d8aace1b80db102241f5e;p=karo-tx-linux.git mm, mempolicy: remove duplicate code Remove some duplicate code and simplify alloc_pages_vma(). No functional change. Signed-off-by: David Rientjes Cc: KOSAKI Motohiro Signed-off-by: Andrew Morton --- diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 1ac0479e85a3..a40e0d2a3fab 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1942,7 +1942,6 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, unsigned long addr, int node) { struct mempolicy *pol; - struct zonelist *zl; struct page *page; unsigned int cpuset_mems_cookie; @@ -1961,23 +1960,11 @@ retry_cpuset: return page; } - zl = policy_zonelist(gfp, pol, node); - if (unlikely(mpol_needs_cond_ref(pol))) { - /* - * slow path: ref counted shared policy - */ - struct page *page = __alloc_pages_nodemask(gfp, order, - zl, policy_nodemask(gfp, pol)); - __mpol_put(pol); - if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) - goto retry_cpuset; - return page; - } - /* - * fast path: default or task policy - */ - page = __alloc_pages_nodemask(gfp, order, zl, + page = __alloc_pages_nodemask(gfp, order, + policy_zonelist(gfp, pol, node), policy_nodemask(gfp, pol)); + if (unlikely(mpol_needs_cond_ref(pol))) + __mpol_put(pol); if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) goto retry_cpuset; return page;