]>
Commit | Line | Data |
---|---|---|
3b4f425a RY |
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 # | |
69cbd0a3 AZ |
7 | dnl # 5.12 API change, |
8 | dnl # inode_owner_or_capable() now takes struct user_namespace * | |
9 | dnl # to support idmapped mounts | |
10 | dnl # | |
608f8749 BB |
11 | AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OWNER_OR_CAPABLE], [ |
12 | ZFS_LINUX_TEST_SRC([inode_owner_or_capable], [ | |
3b4f425a RY |
13 | #include <linux/fs.h> |
14 | ],[ | |
15 | struct inode *ip = NULL; | |
16 | (void) inode_owner_or_capable(ip); | |
608f8749 | 17 | ]) |
e2a82961 | 18 | |
d4dc53da | 19 | ZFS_LINUX_TEST_SRC([inode_owner_or_capable_userns], [ |
e2a82961 CK |
20 | #include <linux/fs.h> |
21 | ],[ | |
22 | struct inode *ip = NULL; | |
23 | (void) inode_owner_or_capable(&init_user_ns, ip); | |
24 | ]) | |
d4dc53da YY |
25 | |
26 | ZFS_LINUX_TEST_SRC([inode_owner_or_capable_mnt_idmap], [ | |
27 | #include <linux/fs.h> | |
28 | #include <linux/mnt_idmapping.h> | |
29 | ],[ | |
30 | struct inode *ip = NULL; | |
31 | (void) inode_owner_or_capable(&nop_mnt_idmap, ip); | |
32 | ]) | |
608f8749 BB |
33 | ]) |
34 | ||
35 | AC_DEFUN([ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE], [ | |
36 | AC_MSG_CHECKING([whether inode_owner_or_capable() exists]) | |
37 | ZFS_LINUX_TEST_RESULT([inode_owner_or_capable], [ | |
3b4f425a | 38 | AC_MSG_RESULT(yes) |
e2a82961 CK |
39 | AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1, |
40 | [inode_owner_or_capable() exists]) | |
41 | ], [ | |
42 | AC_MSG_RESULT(no) | |
43 | ||
44 | AC_MSG_CHECKING( | |
45 | [whether inode_owner_or_capable() takes user_ns]) | |
d4dc53da | 46 | ZFS_LINUX_TEST_RESULT([inode_owner_or_capable_userns], [ |
e2a82961 | 47 | AC_MSG_RESULT(yes) |
d4dc53da | 48 | AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE_USERNS, 1, |
e2a82961 CK |
49 | [inode_owner_or_capable() takes user_ns]) |
50 | ],[ | |
d4dc53da YY |
51 | AC_MSG_RESULT(no) |
52 | AC_MSG_CHECKING( | |
53 | [whether inode_owner_or_capable() takes mnt_idmap]) | |
54 | ZFS_LINUX_TEST_RESULT([inode_owner_or_capable_mnt_idmap], [ | |
55 | AC_MSG_RESULT(yes) | |
56 | AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE_IDMAP, 1, | |
57 | [inode_owner_or_capable() takes mnt_idmap]) | |
58 | ], [ | |
59 | ZFS_LINUX_TEST_ERROR([capability]) | |
60 | ]) | |
e2a82961 | 61 | ]) |
3b4f425a RY |
62 | ]) |
63 | ]) |