Skip to content

Commit 2b90594

Browse files
Christoph Hellwigtorvalds
authored andcommitted
mm: remove __vmalloc_node_flags_caller
Just use __vmalloc_node instead which gets and extra argument. To be able to to use __vmalloc_node in all caller make it available outside of vmalloc and implement it in nommu.c. [[email protected]: fix nommu build] Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: David Airlie <[email protected]> Cc: Gao Xiang <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Haiyang Zhang <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: "K. Y. Srinivasan" <[email protected]> Cc: Laura Abbott <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Michael Kelley <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Nitin Gupta <[email protected]> Cc: Robin Murphy <[email protected]> Cc: Sakari Ailus <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: Sumit Semwal <[email protected]> Cc: Wei Liu <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Will Deacon <[email protected]> Cc: Stephen Rothwell <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4d39d72 commit 2b90594

File tree

5 files changed

+9
-18
lines changed

5 files changed

+9
-18
lines changed

include/linux/vmalloc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ extern void *__vmalloc_node_range(unsigned long size, unsigned long align,
115115
unsigned long start, unsigned long end, gfp_t gfp_mask,
116116
pgprot_t prot, unsigned long vm_flags, int node,
117117
const void *caller);
118-
extern void *__vmalloc_node_flags_caller(unsigned long size,
119-
int node, gfp_t flags, void *caller);
118+
void *__vmalloc_node(unsigned long size, unsigned long align, gfp_t gfp_mask,
119+
int node, const void *caller);
120120

121121
extern void vfree(const void *addr);
122122
extern void vfree_atomic(const void *addr);

kernel/bpf/syscall.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,8 @@ static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable)
299299
return vmalloc_user_node_flags(size, numa_node, GFP_KERNEL |
300300
__GFP_RETRY_MAYFAIL | flags);
301301
}
302-
return __vmalloc_node_flags_caller(size, numa_node,
303-
GFP_KERNEL | __GFP_RETRY_MAYFAIL |
304-
flags, __builtin_return_address(0));
302+
return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_RETRY_MAYFAIL | flags,
303+
numa_node, __builtin_return_address(0));
305304
}
306305

307306
void *bpf_map_area_alloc(u64 size, int numa_node)

mm/nommu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask)
150150
}
151151
EXPORT_SYMBOL(__vmalloc);
152152

153-
void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags,
154-
void *caller)
153+
void *__vmalloc_node(unsigned long size, unsigned long align, gfp_t gfp_mask,
154+
int node, const void *caller)
155155
{
156-
return __vmalloc(size, flags);
156+
return __vmalloc(size, gfp_mask);
157157
}
158158

159159
static void *__vmalloc_user_flags(unsigned long size, gfp_t flags)

mm/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ void *kvmalloc_node(size_t size, gfp_t flags, int node)
580580
if (ret || size <= PAGE_SIZE)
581581
return ret;
582582

583-
return __vmalloc_node_flags_caller(size, node, flags,
583+
return __vmalloc_node(size, 1, flags, node,
584584
__builtin_return_address(0));
585585
}
586586
EXPORT_SYMBOL(kvmalloc_node);

mm/vmalloc.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,8 +2401,6 @@ void *vmap(struct page **pages, unsigned int count,
24012401
}
24022402
EXPORT_SYMBOL(vmap);
24032403

2404-
static void *__vmalloc_node(unsigned long size, unsigned long align,
2405-
gfp_t gfp_mask, int node, const void *caller);
24062404
static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
24072405
pgprot_t prot, int node)
24082406
{
@@ -2553,7 +2551,7 @@ EXPORT_SYMBOL_GPL(__vmalloc_node_range);
25532551
*
25542552
* Return: pointer to the allocated memory or %NULL on error
25552553
*/
2556-
static void *__vmalloc_node(unsigned long size, unsigned long align,
2554+
void *__vmalloc_node(unsigned long size, unsigned long align,
25572555
gfp_t gfp_mask, int node, const void *caller)
25582556
{
25592557
return __vmalloc_node_range(size, align, VMALLOC_START, VMALLOC_END,
@@ -2567,12 +2565,6 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask)
25672565
}
25682566
EXPORT_SYMBOL(__vmalloc);
25692567

2570-
void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags,
2571-
void *caller)
2572-
{
2573-
return __vmalloc_node(size, 1, flags, node, caller);
2574-
}
2575-
25762568
/**
25772569
* vmalloc - allocate virtually contiguous memory
25782570
* @size: allocation size

0 commit comments

Comments
 (0)