]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-kmem-cache.m4
Change target size of metaslabs from 256GB to 16GB
[mirror_zfs.git] / config / kernel-kmem-cache.m4
CommitLineData
48ef8ba0
BB
1dnl #
2dnl # 2.6.35 API change,
3dnl # The cachep->gfpflags member was renamed cachep->allocflags. These are
4dnl # private allocation flags which are applied when allocating a new slab
5dnl # in kmem_getpages(). Unfortunately there is no public API for setting
6dnl # non-default flags.
7dnl #
93ce2b4c 8AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_ALLOCFLAGS], [
48ef8ba0 9 AC_MSG_CHECKING([whether struct kmem_cache has allocflags])
93ce2b4c 10 ZFS_LINUX_TRY_COMPILE([
48ef8ba0
BB
11 #include <linux/slab.h>
12 ],[
13 struct kmem_cache cachep __attribute__ ((unused));
14 cachep.allocflags = GFP_KERNEL;
15 ],[
16 AC_MSG_RESULT(yes)
17 AC_DEFINE(HAVE_KMEM_CACHE_ALLOCFLAGS, 1,
18 [struct kmem_cache has allocflags])
19 ],[
20 AC_MSG_RESULT(no)
21
22 AC_MSG_CHECKING([whether struct kmem_cache has gfpflags])
93ce2b4c 23 ZFS_LINUX_TRY_COMPILE([
48ef8ba0
BB
24 #include <linux/slab.h>
25 ],[
26 struct kmem_cache cachep __attribute__ ((unused));
27 cachep.gfpflags = GFP_KERNEL;
28 ],[
29 AC_MSG_RESULT(yes)
30 AC_DEFINE(HAVE_KMEM_CACHE_GFPFLAGS, 1,
31 [struct kmem_cache has gfpflags])
32 ],[
33 AC_MSG_RESULT(no)
34 ])
35 ])
36])
37
38dnl #
39dnl # grsecurity API change,
40dnl # kmem_cache_create() with SLAB_USERCOPY flag replaced by
41dnl # kmem_cache_create_usercopy().
42dnl #
93ce2b4c 43AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY], [
48ef8ba0
BB
44 AC_MSG_CHECKING([whether kmem_cache_create_usercopy() exists])
45 tmp_flags="$EXTRA_KCFLAGS"
46 EXTRA_KCFLAGS="-Werror"
93ce2b4c 47 ZFS_LINUX_TRY_COMPILE([
48ef8ba0
BB
48 #include <linux/slab.h>
49 static void ctor(void *foo)
50 {
51 // fake ctor
52 }
53 ],[
54 struct kmem_cache *skc_linux_cache;
55 const char *name = "test";
56 size_t size = 4096;
57 size_t align = 8;
58 unsigned long flags = 0;
59 size_t useroffset = 0;
60 size_t usersize = size - useroffset;
61
62 skc_linux_cache = kmem_cache_create_usercopy(
63 name, size, align, flags, useroffset, usersize, ctor);
64 ],[
65 AC_MSG_RESULT(yes)
66 AC_DEFINE(HAVE_KMEM_CACHE_CREATE_USERCOPY, 1,
67 [kmem_cache_create_usercopy() exists])
68 ],[
69 AC_MSG_RESULT(no)
70 ])
71 EXTRA_KCFLAGS="$tmp_flags"
72])