xref: /freebsd/sys/contrib/openzfs/config/kernel-inode-getattr.m4 (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1dnl #
2dnl # Linux 4.11 API
3dnl # See torvalds/linux@a528d35
4dnl #
5AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
6	ZFS_LINUX_TEST_SRC([inode_operations_getattr_path], [
7		#include <linux/fs.h>
8
9		int test_getattr(
10		    const struct path *p, struct kstat *k,
11		    u32 request_mask, unsigned int query_flags)
12		    { return 0; }
13
14		static const struct inode_operations
15		    iops __attribute__ ((unused)) = {
16			.getattr = test_getattr,
17		};
18	],[])
19
20	ZFS_LINUX_TEST_SRC([inode_operations_getattr_vfsmount], [
21		#include <linux/fs.h>
22
23		int test_getattr(
24		    struct vfsmount *mnt, struct dentry *d,
25		    struct kstat *k)
26		    { return 0; }
27
28		static const struct inode_operations
29		    iops __attribute__ ((unused)) = {
30			.getattr = test_getattr,
31		};
32	],[])
33])
34
35AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
36	AC_MSG_CHECKING([whether iops->getattr() takes a path])
37	ZFS_LINUX_TEST_RESULT([inode_operations_getattr_path], [
38		AC_MSG_RESULT(yes)
39		AC_DEFINE(HAVE_PATH_IOPS_GETATTR, 1,
40		    [iops->getattr() takes a path])
41	],[
42		AC_MSG_RESULT(no)
43
44		AC_MSG_CHECKING([whether iops->getattr() takes a vfsmount])
45		ZFS_LINUX_TEST_RESULT([inode_operations_getattr_vfsmount], [
46			AC_MSG_RESULT(yes)
47			AC_DEFINE(HAVE_VFSMOUNT_IOPS_GETATTR, 1,
48			    [iops->getattr() takes a vfsmount])
49		],[
50			AC_MSG_RESULT(no)
51		])
52	])
53])
54