mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 16:33:17 +00:00
Move remaining definitions and declarations from include/linux/bootmem.h into include/linux/memblock.h and remove the redundant header. The includes were replaced with the semantic patch below and then semi-automated removal of duplicated '#include <linux/memblock.h> @@ @@ - #include <linux/bootmem.h> + #include <linux/memblock.h> [[email protected]: dma-direct: fix up for the removal of linux/bootmem.h] Link: http://lkml.kernel.org/r/[email protected] [[email protected]: powerpc: fix up for removal of linux/bootmem.h] Link: http://lkml.kernel.org/r/[email protected] [[email protected]: x86/kaslr, ACPI/NUMA: fix for linux/bootmem.h removal] Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Mike Rapoport <[email protected]> Signed-off-by: Stephen Rothwell <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Chris Zankel <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Greentime Hu <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Guan Xuetao <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Jonas Bonn <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Ley Foon Tan <[email protected]> Cc: Mark Salter <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Matt Turner <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Michal Simek <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Paul Burton <[email protected]> Cc: Richard Kuo <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Rich Felker <[email protected]> Cc: Russell King <[email protected]> Cc: Serge Semin <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Tony Luck <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: Yoshinori Sato <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
41 lines
803 B
C
41 lines
803 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/* xfrm_hash.c: Common hash table code.
|
|
*
|
|
* Copyright (C) 2006 David S. Miller ([email protected])
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/memblock.h>
|
|
#include <linux/vmalloc.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/xfrm.h>
|
|
|
|
#include "xfrm_hash.h"
|
|
|
|
struct hlist_head *xfrm_hash_alloc(unsigned int sz)
|
|
{
|
|
struct hlist_head *n;
|
|
|
|
if (sz <= PAGE_SIZE)
|
|
n = kzalloc(sz, GFP_KERNEL);
|
|
else if (hashdist)
|
|
n = vzalloc(sz);
|
|
else
|
|
n = (struct hlist_head *)
|
|
__get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO,
|
|
get_order(sz));
|
|
|
|
return n;
|
|
}
|
|
|
|
void xfrm_hash_free(struct hlist_head *n, unsigned int sz)
|
|
{
|
|
if (sz <= PAGE_SIZE)
|
|
kfree(n);
|
|
else if (hashdist)
|
|
vfree(n);
|
|
else
|
|
free_pages((unsigned long)n, get_order(sz));
|
|
}
|