mirror_zfs/config/kernel-create-nameidata.m4
Brian Behlendorf bd29109f1a Linux 4.2 compat: follow_link() / put_link()
As of Linux 4.2 the kernel has completely retired the nameidata
structure.  One of the few remaining consumers of this interface
were the follow_link() and put_link() callbacks.

This patch adds the required checks to configure to detect the
interface change and updates the functions accordingly.  Migrating
to the simple_follow_link() interface was considered but was decided
against ironically due to the increased complexity.

It also should be noted that the kernel follow_link() and put_link()
interfaces changes several times after 4.1 and but before 4.2.  This
means there is a narrow range of kernel commits which never appear
in an official tag of the Linux kernel which ZoL will not build.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Issue #3596
2015-07-17 09:18:16 -07:00

30 lines
738 B
Plaintext

dnl #
dnl # 3.6 API change
dnl #
AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
AC_MSG_CHECKING([whether iops->create() passes nameidata])
ZFS_LINUX_TRY_COMPILE([
#include <linux/fs.h>
#ifdef HAVE_MKDIR_UMODE_T
int inode_create(struct inode *inode ,struct dentry *dentry,
umode_t umode, struct nameidata *nidata) { return 0; }
#else
int inode_create(struct inode *inode,struct dentry *dentry,
int umode, struct nameidata * nidata) { return 0; }
#endif
static const struct inode_operations
iops __attribute__ ((unused)) = {
.create = inode_create,
};
],[
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CREATE_NAMEIDATA, 1,
[iops->create() passes nameidata])
],[
AC_MSG_RESULT(no)
])
])