xref: /freebsd/sys/contrib/openzfs/config/kernel-rename.m4 (revision eda14cbc264d6969b02f2b1994cef11148e914f1)
1*eda14cbcSMatt Macydnl #
2*eda14cbcSMatt Macydnl # 4.9 API change,
3*eda14cbcSMatt Macydnl # iops->rename2() merged into iops->rename(), and iops->rename() now wants
4*eda14cbcSMatt Macydnl # flags.
5*eda14cbcSMatt Macydnl #
6*eda14cbcSMatt MacyAC_DEFUN([ZFS_AC_KERNEL_SRC_RENAME_WANTS_FLAGS], [
7*eda14cbcSMatt Macy	ZFS_LINUX_TEST_SRC([inode_operations_rename], [
8*eda14cbcSMatt Macy		#include <linux/fs.h>
9*eda14cbcSMatt Macy		int rename_fn(struct inode *sip, struct dentry *sdp,
10*eda14cbcSMatt Macy			struct inode *tip, struct dentry *tdp,
11*eda14cbcSMatt Macy			unsigned int flags) { return 0; }
12*eda14cbcSMatt Macy
13*eda14cbcSMatt Macy		static const struct inode_operations
14*eda14cbcSMatt Macy		    iops __attribute__ ((unused)) = {
15*eda14cbcSMatt Macy			.rename = rename_fn,
16*eda14cbcSMatt Macy		};
17*eda14cbcSMatt Macy	],[])
18*eda14cbcSMatt Macy])
19*eda14cbcSMatt Macy
20*eda14cbcSMatt MacyAC_DEFUN([ZFS_AC_KERNEL_RENAME_WANTS_FLAGS], [
21*eda14cbcSMatt Macy	AC_MSG_CHECKING([whether iops->rename() wants flags])
22*eda14cbcSMatt Macy	ZFS_LINUX_TEST_RESULT([inode_operations_rename], [
23*eda14cbcSMatt Macy		AC_MSG_RESULT(yes)
24*eda14cbcSMatt Macy		AC_DEFINE(HAVE_RENAME_WANTS_FLAGS, 1,
25*eda14cbcSMatt Macy		    [iops->rename() wants flags])
26*eda14cbcSMatt Macy	],[
27*eda14cbcSMatt Macy		AC_MSG_RESULT(no)
28*eda14cbcSMatt Macy	])
29*eda14cbcSMatt Macy])
30