]>
Commit | Line | Data |
---|---|---|
608f8749 | 1 | AC_DEFUN([ZFS_AC_KERNEL_SRC_SETATTR_PREPARE], [ |
e2a82961 CK |
2 | dnl # |
3 | dnl # 4.9 API change | |
4 | dnl # The inode_change_ok() function has been renamed setattr_prepare() | |
5 | dnl # and updated to take a dentry rather than an inode. | |
6 | dnl # | |
608f8749 | 7 | ZFS_LINUX_TEST_SRC([setattr_prepare], [ |
3b0ba3ba BB |
8 | #include <linux/fs.h> |
9 | ], [ | |
10 | struct dentry *dentry = NULL; | |
11 | struct iattr *attr = NULL; | |
608f8749 | 12 | int error __attribute__ ((unused)) = |
e2a82961 CK |
13 | setattr_prepare(dentry, attr); |
14 | ]) | |
15 | ||
16 | dnl # | |
17 | dnl # 5.12 API change | |
18 | dnl # The setattr_prepare() function has been changed to accept a new argument | |
19 | dnl # for struct user_namespace* | |
20 | dnl # | |
21 | ZFS_LINUX_TEST_SRC([setattr_prepare_userns], [ | |
22 | #include <linux/fs.h> | |
23 | ], [ | |
24 | struct dentry *dentry = NULL; | |
25 | struct iattr *attr = NULL; | |
26 | struct user_namespace *userns = NULL; | |
27 | int error __attribute__ ((unused)) = | |
28 | setattr_prepare(userns, dentry, attr); | |
608f8749 | 29 | ]) |
d4dc53da YY |
30 | |
31 | dnl # | |
32 | dnl # 6.3 API change | |
33 | dnl # The first arg of setattr_prepare() is changed to struct mnt_idmap* | |
34 | dnl # | |
35 | ZFS_LINUX_TEST_SRC([setattr_prepare_mnt_idmap], [ | |
36 | #include <linux/fs.h> | |
37 | ], [ | |
38 | struct dentry *dentry = NULL; | |
39 | struct iattr *attr = NULL; | |
40 | struct mnt_idmap *idmap = NULL; | |
41 | int error __attribute__ ((unused)) = | |
42 | setattr_prepare(idmap, dentry, attr); | |
43 | ]) | |
608f8749 | 44 | ]) |
3b0ba3ba | 45 | |
608f8749 | 46 | AC_DEFUN([ZFS_AC_KERNEL_SETATTR_PREPARE], [ |
d4dc53da YY |
47 | AC_MSG_CHECKING([whether setattr_prepare() is available and accepts struct mnt_idmap*]) |
48 | ZFS_LINUX_TEST_RESULT_SYMBOL([setattr_prepare_mnt_idmap], | |
608f8749 | 49 | [setattr_prepare], [fs/attr.c], [ |
3b0ba3ba | 50 | AC_MSG_RESULT(yes) |
d4dc53da YY |
51 | AC_DEFINE(HAVE_SETATTR_PREPARE_IDMAP, 1, |
52 | [setattr_prepare() accepts mnt_idmap]) | |
3b0ba3ba | 53 | ], [ |
d4dc53da YY |
54 | AC_MSG_CHECKING([whether setattr_prepare() is available and accepts struct user_namespace*]) |
55 | ZFS_LINUX_TEST_RESULT_SYMBOL([setattr_prepare_userns], | |
56 | [setattr_prepare], [fs/attr.c], [ | |
e2a82961 | 57 | AC_MSG_RESULT(yes) |
d4dc53da YY |
58 | AC_DEFINE(HAVE_SETATTR_PREPARE_USERNS, 1, |
59 | [setattr_prepare() accepts user_namespace]) | |
e2a82961 CK |
60 | ], [ |
61 | AC_MSG_RESULT(no) | |
d4dc53da YY |
62 | |
63 | AC_MSG_CHECKING([whether setattr_prepare() is available, doesn't accept user_namespace]) | |
64 | ZFS_LINUX_TEST_RESULT_SYMBOL([setattr_prepare], | |
65 | [setattr_prepare], [fs/attr.c], [ | |
66 | AC_MSG_RESULT(yes) | |
67 | AC_DEFINE(HAVE_SETATTR_PREPARE_NO_USERNS, 1, | |
68 | [setattr_prepare() is available, doesn't accept user_namespace]) | |
69 | ], [ | |
70 | AC_MSG_RESULT(no) | |
71 | ]) | |
e2a82961 | 72 | ]) |
3b0ba3ba BB |
73 | ]) |
74 | ]) |