Skip to content

Commit 4d39d72

Browse files
Christoph Hellwigtorvalds
authored andcommitted
mm: remove both instances of __vmalloc_node_flags
The real version just had a few callers that can open code it and remove one layer of indirection. The nommu stub was public but only had a single caller, so remove it and avoid a CONFIG_MMU ifdef in vmalloc.h. 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]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent f38fcb9 commit 4d39d72

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

include/linux/vmalloc.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +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-
#ifndef CONFIG_MMU
119-
extern void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags);
120-
static inline void *__vmalloc_node_flags_caller(unsigned long size, int node,
121-
gfp_t flags, void *caller)
122-
{
123-
return __vmalloc_node_flags(size, node, flags);
124-
}
125-
#else
126118
extern void *__vmalloc_node_flags_caller(unsigned long size,
127119
int node, gfp_t flags, void *caller);
128-
#endif
129120

130121
extern void vfree(const void *addr);
131122
extern void vfree_atomic(const void *addr);

mm/nommu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask)
150150
}
151151
EXPORT_SYMBOL(__vmalloc);
152152

153-
void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags)
153+
void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags,
154+
void *caller)
154155
{
155156
return __vmalloc(size, flags);
156157
}

mm/vmalloc.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,14 +2567,6 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask)
25672567
}
25682568
EXPORT_SYMBOL(__vmalloc);
25692569

2570-
static inline void *__vmalloc_node_flags(unsigned long size,
2571-
int node, gfp_t flags)
2572-
{
2573-
return __vmalloc_node(size, 1, flags, node,
2574-
__builtin_return_address(0));
2575-
}
2576-
2577-
25782570
void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags,
25792571
void *caller)
25802572
{
@@ -2595,8 +2587,8 @@ void *__vmalloc_node_flags_caller(unsigned long size, int node, gfp_t flags,
25952587
*/
25962588
void *vmalloc(unsigned long size)
25972589
{
2598-
return __vmalloc_node_flags(size, NUMA_NO_NODE,
2599-
GFP_KERNEL);
2590+
return __vmalloc_node(size, 1, GFP_KERNEL, NUMA_NO_NODE,
2591+
__builtin_return_address(0));
26002592
}
26012593
EXPORT_SYMBOL(vmalloc);
26022594

@@ -2615,8 +2607,8 @@ EXPORT_SYMBOL(vmalloc);
26152607
*/
26162608
void *vzalloc(unsigned long size)
26172609
{
2618-
return __vmalloc_node_flags(size, NUMA_NO_NODE,
2619-
GFP_KERNEL | __GFP_ZERO);
2610+
return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_ZERO, NUMA_NO_NODE,
2611+
__builtin_return_address(0));
26202612
}
26212613
EXPORT_SYMBOL(vzalloc);
26222614

@@ -2671,8 +2663,8 @@ EXPORT_SYMBOL(vmalloc_node);
26712663
*/
26722664
void *vzalloc_node(unsigned long size, int node)
26732665
{
2674-
return __vmalloc_node_flags(size, node,
2675-
GFP_KERNEL | __GFP_ZERO);
2666+
return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_ZERO, node,
2667+
__builtin_return_address(0));
26762668
}
26772669
EXPORT_SYMBOL(vzalloc_node);
26782670

0 commit comments

Comments
 (0)