2011-12-22 20:20:43 +00:00
|
|
|
dnl #
|
|
|
|
dnl # 3.1 API change
|
|
|
|
dnl # The super_block structure now stores a per-filesystem shrinker.
|
|
|
|
dnl # This interface is preferable because it can be used to specifically
|
|
|
|
dnl # target only the zfs filesystem for pruning.
|
|
|
|
dnl #
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_SHRINK], [
|
|
|
|
AC_MSG_CHECKING([whether super_block has s_shrink])
|
|
|
|
ZFS_LINUX_TRY_COMPILE([
|
|
|
|
#include <linux/fs.h>
|
2013-02-14 23:54:04 +00:00
|
|
|
|
|
|
|
int shrink(struct shrinker *s, struct shrink_control *sc)
|
|
|
|
{ return 0; }
|
|
|
|
|
|
|
|
static const struct super_block
|
|
|
|
sb __attribute__ ((unused)) = {
|
2011-12-22 20:20:43 +00:00
|
|
|
.s_shrink.shrink = shrink,
|
|
|
|
.s_shrink.seeks = DEFAULT_SEEKS,
|
|
|
|
.s_shrink.batch = 0,
|
|
|
|
};
|
2013-02-14 23:54:04 +00:00
|
|
|
],[
|
2011-12-22 20:20:43 +00:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_SHRINK, 1, [struct super_block has s_shrink])
|
|
|
|
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_NR_CACHED_OBJECTS], [
|
|
|
|
AC_MSG_CHECKING([whether sops->nr_cached_objects() exists])
|
|
|
|
ZFS_LINUX_TRY_COMPILE([
|
|
|
|
#include <linux/fs.h>
|
2013-02-14 23:54:04 +00:00
|
|
|
|
|
|
|
int nr_cached_objects(struct super_block *sb) { return 0; }
|
|
|
|
|
|
|
|
static const struct super_operations
|
|
|
|
sops __attribute__ ((unused)) = {
|
2011-12-22 20:20:43 +00:00
|
|
|
.nr_cached_objects = nr_cached_objects,
|
|
|
|
};
|
2013-02-14 23:54:04 +00:00
|
|
|
],[
|
2011-12-22 20:20:43 +00:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_NR_CACHED_OBJECTS, 1,
|
|
|
|
[sops->nr_cached_objects() exists])
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_FREE_CACHED_OBJECTS], [
|
|
|
|
AC_MSG_CHECKING([whether sops->free_cached_objects() exists])
|
|
|
|
ZFS_LINUX_TRY_COMPILE([
|
|
|
|
#include <linux/fs.h>
|
2013-02-14 23:54:04 +00:00
|
|
|
|
|
|
|
void free_cached_objects(struct super_block *sb, int x)
|
|
|
|
{ return; }
|
|
|
|
|
|
|
|
static const struct super_operations
|
|
|
|
sops __attribute__ ((unused)) = {
|
2011-12-22 20:20:43 +00:00
|
|
|
.free_cached_objects = free_cached_objects,
|
|
|
|
};
|
2013-02-14 23:54:04 +00:00
|
|
|
],[
|
2011-12-22 20:20:43 +00:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_FREE_CACHED_OBJECTS, 1,
|
|
|
|
[sops->free_cached_objects() exists])
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|
|
|
|
])
|