3 dnl # The super_block structure now stores a per-filesystem shrinker.
4 dnl # This interface is preferable because it can be used to specifically
5 dnl # target only the zfs filesystem for pruning.
7 AC_DEFUN([ZFS_AC_KERNEL_SHRINK], [
8 AC_MSG_CHECKING([whether super_block has s_shrink])
9 ZFS_LINUX_TRY_COMPILE([
12 int shrink(struct shrinker *s, struct shrink_control *sc)
15 static const struct super_block
16 sb __attribute__ ((unused)) = {
17 .s_shrink.shrink = shrink,
18 .s_shrink.seeks = DEFAULT_SEEKS,
24 AC_DEFINE(HAVE_SHRINK, 1, [struct super_block has s_shrink])
31 AC_DEFUN([ZFS_AC_KERNEL_NR_CACHED_OBJECTS], [
32 AC_MSG_CHECKING([whether sops->nr_cached_objects() exists])
33 ZFS_LINUX_TRY_COMPILE([
36 int nr_cached_objects(struct super_block *sb) { return 0; }
38 static const struct super_operations
39 sops __attribute__ ((unused)) = {
40 .nr_cached_objects = nr_cached_objects,
45 AC_DEFINE(HAVE_NR_CACHED_OBJECTS, 1,
46 [sops->nr_cached_objects() exists])
52 AC_DEFUN([ZFS_AC_KERNEL_FREE_CACHED_OBJECTS], [
53 AC_MSG_CHECKING([whether sops->free_cached_objects() exists])
54 ZFS_LINUX_TRY_COMPILE([
57 void free_cached_objects(struct super_block *sb, int x)
60 static const struct super_operations
61 sops __attribute__ ((unused)) = {
62 .free_cached_objects = free_cached_objects,
67 AC_DEFINE(HAVE_FREE_CACHED_OBJECTS, 1,
68 [sops->free_cached_objects() exists])