1 /* xfrm_hash.c: Common hash table code.
3 * Copyright (C) 2006 David S. Miller (davem@davemloft.net)
6 #include <linux/kernel.h>
8 #include <linux/bootmem.h>
9 #include <linux/vmalloc.h>
10 #include <linux/slab.h>
11 #include <linux/xfrm.h>
13 #include "xfrm_hash.h"
15 struct hlist_head
*xfrm_hash_alloc(unsigned int sz
)
20 n
= kzalloc(sz
, GFP_KERNEL
);
22 n
= __vmalloc(sz
, GFP_KERNEL
| __GFP_ZERO
, PAGE_KERNEL
);
24 n
= (struct hlist_head
*)
25 __get_free_pages(GFP_KERNEL
| __GFP_NOWARN
| __GFP_ZERO
,
31 void xfrm_hash_free(struct hlist_head
*n
, unsigned int sz
)
38 free_pages((unsigned long)n
, get_order(sz
));