diff options
author | Wanpeng Li <liwanp@linux.vnet.ibm.com> | 2013-11-12 18:07:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:05 -0500 |
commit | 3722e13cff361035583f6ecfa784437b824fe659 (patch) | |
tree | c44f134dfe252ce995ae5810a46e07f04513eadd /mm/vmalloc.c | |
parent | 948927ee9e4f35f287e61a79c9f0e85ca2202c7d (diff) |
mm/vmalloc: don't set area->caller twice
The caller address has already been set in set_vmalloc_vm(), there's no
need to set it again in __vmalloc_area_node.
Reviewed-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Mitsuo Hayasaka <mitsuo.hayasaka.hu@hitachi.com>
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 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index dea15e6bfc8d..285f0e7d28e7 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -1546,7 +1546,7 @@ static void *__vmalloc_node(unsigned long size, unsigned long align, | |||
1546 | gfp_t gfp_mask, pgprot_t prot, | 1546 | gfp_t gfp_mask, pgprot_t prot, |
1547 | int node, const void *caller); | 1547 | int node, const void *caller); |
1548 | static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, | 1548 | static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, |
1549 | pgprot_t prot, int node, const void *caller) | 1549 | pgprot_t prot, int node) |
1550 | { | 1550 | { |
1551 | const int order = 0; | 1551 | const int order = 0; |
1552 | struct page **pages; | 1552 | struct page **pages; |
@@ -1560,13 +1560,12 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, | |||
1560 | /* Please note that the recursion is strictly bounded. */ | 1560 | /* Please note that the recursion is strictly bounded. */ |
1561 | if (array_size > PAGE_SIZE) { | 1561 | if (array_size > PAGE_SIZE) { |
1562 | pages = __vmalloc_node(array_size, 1, nested_gfp|__GFP_HIGHMEM, | 1562 | pages = __vmalloc_node(array_size, 1, nested_gfp|__GFP_HIGHMEM, |
1563 | PAGE_KERNEL, node, caller); | 1563 | PAGE_KERNEL, node, area->caller); |
1564 | area->flags |= VM_VPAGES; | 1564 | area->flags |= VM_VPAGES; |
1565 | } else { | 1565 | } else { |
1566 | pages = kmalloc_node(array_size, nested_gfp, node); | 1566 | pages = kmalloc_node(array_size, nested_gfp, node); |
1567 | } | 1567 | } |
1568 | area->pages = pages; | 1568 | area->pages = pages; |
1569 | area->caller = caller; | ||
1570 | if (!area->pages) { | 1569 | if (!area->pages) { |
1571 | remove_vm_area(area->addr); | 1570 | remove_vm_area(area->addr); |
1572 | kfree(area); | 1571 | kfree(area); |
@@ -1634,7 +1633,7 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align, | |||
1634 | if (!area) | 1633 | if (!area) |
1635 | goto fail; | 1634 | goto fail; |
1636 | 1635 | ||
1637 | addr = __vmalloc_area_node(area, gfp_mask, prot, node, caller); | 1636 | addr = __vmalloc_area_node(area, gfp_mask, prot, node); |
1638 | if (!addr) | 1637 | if (!addr) |
1639 | goto fail; | 1638 | goto fail; |
1640 | 1639 | ||