]> git.proxmox.com Git - mirror_zfs-debian.git/blame - config/kernel-shrink.m4
Update SAs when an inode is dirtied
[mirror_zfs-debian.git] / config / kernel-shrink.m4
CommitLineData
ab26409d
BB
1dnl #
2dnl # 3.1 API change
3dnl # The super_block structure now stores a per-filesystem shrinker.
4dnl # This interface is preferable because it can be used to specifically
5dnl # target only the zfs filesystem for pruning.
6dnl #
7AC_DEFUN([ZFS_AC_KERNEL_SHRINK], [
8 AC_MSG_CHECKING([whether super_block has s_shrink])
9 ZFS_LINUX_TRY_COMPILE([
10 #include <linux/fs.h>
11 ],[
12 int (*shrink)(struct shrinker *, struct shrink_control *sc)
13 __attribute__ ((unused)) = NULL;
14 struct super_block sb __attribute__ ((unused)) = {
15 .s_shrink.shrink = shrink,
16 .s_shrink.seeks = DEFAULT_SEEKS,
17 .s_shrink.batch = 0,
18 };
19 ],[
20 AC_MSG_RESULT(yes)
21 AC_DEFINE(HAVE_SHRINK, 1, [struct super_block has s_shrink])
22
23 ],[
24 AC_MSG_RESULT(no)
25 ])
26])
27
28AC_DEFUN([ZFS_AC_KERNEL_NR_CACHED_OBJECTS], [
29 AC_MSG_CHECKING([whether sops->nr_cached_objects() exists])
30 ZFS_LINUX_TRY_COMPILE([
31 #include <linux/fs.h>
32 ],[
33 int (*nr_cached_objects)(struct super_block *)
34 __attribute__ ((unused)) = NULL;
35 struct super_operations sops __attribute__ ((unused)) = {
36 .nr_cached_objects = nr_cached_objects,
37 };
38 ],[
39 AC_MSG_RESULT(yes)
40 AC_DEFINE(HAVE_NR_CACHED_OBJECTS, 1,
41 [sops->nr_cached_objects() exists])
42 ],[
43 AC_MSG_RESULT(no)
44 ])
45])
46
47AC_DEFUN([ZFS_AC_KERNEL_FREE_CACHED_OBJECTS], [
48 AC_MSG_CHECKING([whether sops->free_cached_objects() exists])
49 ZFS_LINUX_TRY_COMPILE([
50 #include <linux/fs.h>
51 ],[
52 void (*free_cached_objects)(struct super_block *, int)
53 __attribute__ ((unused)) = NULL;
54 struct super_operations sops __attribute__ ((unused)) = {
55 .free_cached_objects = free_cached_objects,
56 };
57 ],[
58 AC_MSG_RESULT(yes)
59 AC_DEFINE(HAVE_FREE_CACHED_OBJECTS, 1,
60 [sops->free_cached_objects() exists])
61 ],[
62 AC_MSG_RESULT(no)
63 ])
64])