]> granicus.if.org Git - zfs/blob - config/kernel-is_owner_or_cap.m4
Fix for ARC sysctls ignored at runtime
[zfs] / config / kernel-is_owner_or_cap.m4
1 dnl #
2 dnl # 2.6.39 API change,
3 dnl # The is_owner_or_cap() macro was renamed to inode_owner_or_capable(),
4 dnl # This is used for permission checks in the xattr and file attribute call
5 dnl # paths.
6 dnl #
7 AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OWNER_OR_CAPABLE], [
8         ZFS_LINUX_TEST_SRC([inode_owner_or_capable], [
9                 #include <linux/fs.h>
10         ],[
11                 struct inode *ip = NULL;
12                 (void) inode_owner_or_capable(ip);
13         ])
14
15
16         ZFS_LINUX_TEST_SRC([is_owner_or_cap], [
17                 #include <linux/fs.h>
18                 #include <linux/sched.h>
19         ],[
20                 struct inode *ip = NULL;
21                 (void) is_owner_or_cap(ip);
22         ])
23 ])
24
25 AC_DEFUN([ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE], [
26         AC_MSG_CHECKING([whether inode_owner_or_capable() exists])
27         ZFS_LINUX_TEST_RESULT([inode_owner_or_capable], [
28                 AC_MSG_RESULT(yes)
29                 AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
30                     [inode_owner_or_capable() exists])
31         ],[
32                 AC_MSG_RESULT(no)
33                 AC_MSG_CHECKING([whether is_owner_or_cap() exists])
34
35                 ZFS_LINUX_TEST_RESULT([is_owner_or_cap], [
36                         AC_MSG_RESULT(yes)
37                         AC_DEFINE(HAVE_IS_OWNER_OR_CAP, 1,
38                             [is_owner_or_cap() exists])
39                 ],[
40                         ZFS_LINUX_TEST_ERROR([capability])
41                 ])
42         ])
43 ])