]>
Commit | Line | Data |
---|---|---|
023699cd MM |
1 | dnl # |
2 | dnl # Check if posix_acl_release can be used from a CDDL module, | |
3 | dnl # The is_owner_or_cap macro was replaced by | |
4 | dnl # inode_owner_or_capable | |
5 | dnl # | |
6 | AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [ | |
7 | AC_MSG_CHECKING([whether posix_acl_release() is available]) | |
8 | ZFS_LINUX_TRY_COMPILE([ | |
9 | #include <linux/cred.h> | |
10 | #include <linux/fs.h> | |
11 | #include <linux/posix_acl.h> | |
12 | ],[ | |
13 | struct posix_acl* tmp = posix_acl_alloc(1, 0); | |
14 | posix_acl_release(tmp); | |
15 | ],[ | |
16 | AC_MSG_RESULT(yes) | |
17 | AC_DEFINE(HAVE_POSIX_ACL_RELEASE, 1, | |
18 | [posix_acl_release() is available]) | |
19 | ],[ | |
20 | AC_MSG_RESULT(no) | |
21 | ]) | |
22 | ||
23 | AC_MSG_CHECKING([whether posix_acl_release() is GPL-only]) | |
24 | ZFS_LINUX_TRY_COMPILE([ | |
25 | #include <linux/cred.h> | |
26 | #include <linux/fs.h> | |
27 | #include <linux/posix_acl.h> | |
28 | ||
29 | MODULE_LICENSE("CDDL"); | |
30 | ],[ | |
31 | struct posix_acl* tmp = posix_acl_alloc(1, 0); | |
32 | posix_acl_release(tmp); | |
33 | ],[ | |
34 | AC_MSG_RESULT(no) | |
35 | ],[ | |
36 | AC_MSG_RESULT(yes) | |
37 | AC_DEFINE(HAVE_POSIX_ACL_RELEASE_GPL_ONLY, 1, | |
38 | [posix_acl_release() is GPL-only]) | |
39 | ]) | |
40 | ]) | |
41 | ||
42 | dnl # | |
43 | dnl # 3.1 API change, | |
44 | dnl # posix_acl_chmod_masq() is not exported anymore and posix_acl_chmod() | |
45 | dnl # was introduced to replace it. | |
46 | dnl # | |
47 | AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [ | |
48 | AC_MSG_CHECKING([whether posix_acl_chmod exists]) | |
49 | ZFS_LINUX_TRY_COMPILE([ | |
50 | #include <linux/fs.h> | |
51 | #include <linux/posix_acl.h> | |
52 | ],[ | |
53 | posix_acl_chmod(NULL, 0, 0) | |
54 | ],[ | |
55 | AC_MSG_RESULT(yes) | |
56 | AC_DEFINE(HAVE_POSIX_ACL_CHMOD, 1, [posix_acl_chmod() exists]) | |
57 | ],[ | |
58 | AC_MSG_RESULT(no) | |
59 | ]) | |
60 | ]) | |
61 | ||
62 | dnl # | |
63 | dnl # 2.6.30 API change, | |
64 | dnl # caching of ACL into the inode was added in this version. | |
65 | dnl # | |
66 | AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CACHING], [ | |
67 | AC_MSG_CHECKING([whether inode has i_acl and i_default_acl]) | |
68 | ZFS_LINUX_TRY_COMPILE([ | |
69 | #include <linux/fs.h> | |
70 | ],[ | |
71 | struct inode ino; | |
72 | ino.i_acl = NULL; | |
73 | ino.i_default_acl = NULL; | |
74 | ],[ | |
75 | AC_MSG_RESULT(yes) | |
76 | AC_DEFINE(HAVE_POSIX_ACL_CACHING, 1, | |
77 | [inode contains i_acl and i_default_acl]) | |
78 | ],[ | |
79 | AC_MSG_RESULT(no) | |
80 | ]) | |
81 | ]) | |
82 | ||
83 | dnl # | |
84 | dnl # 3.1 API change, | |
85 | dnl # posix_acl_equiv_mode now wants an umode_t* instead of a mode_t* | |
86 | dnl # | |
87 | AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [ | |
88 | AC_MSG_CHECKING([whether posix_acl_equiv_mode() wants umode_t]) | |
89 | ZFS_LINUX_TRY_COMPILE([ | |
90 | #include <linux/fs.h> | |
91 | #include <linux/posix_acl.h> | |
92 | ],[ | |
93 | umode_t tmp; | |
94 | posix_acl_equiv_mode(NULL,&tmp); | |
95 | ],[ | |
96 | AC_MSG_RESULT(yes) | |
97 | AC_DEFINE(HAVE_POSIX_ACL_EQUIV_MODE_UMODE_T, 1, | |
98 | [ posix_acl_equiv_mode wants umode_t*]) | |
99 | ],[ | |
100 | AC_MSG_RESULT(no) | |
101 | ]) | |
102 | ]) | |
103 | ||
104 | dnl # | |
105 | dnl # 2.6.27 API change, | |
106 | dnl # Check if inode_operations contains the function permission | |
107 | dnl # and expects the nameidata structure to have been removed. | |
108 | dnl # | |
109 | AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION], [ | |
110 | AC_MSG_CHECKING([whether iops->permission() exists]) | |
111 | ZFS_LINUX_TRY_COMPILE([ | |
112 | #include <linux/fs.h> | |
113 | ||
114 | int permission_fn(struct inode *inode, int mask) { return 0; } | |
115 | ||
116 | static const struct inode_operations | |
117 | iops __attribute__ ((unused)) = { | |
118 | .permission = permission_fn, | |
119 | }; | |
120 | ],[ | |
121 | ],[ | |
122 | AC_MSG_RESULT(yes) | |
123 | AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists]) | |
124 | ],[ | |
125 | AC_MSG_RESULT(no) | |
126 | ]) | |
127 | ]) | |
128 | ||
129 | dnl # | |
130 | dnl # 2.6.26 API change, | |
131 | dnl # Check if inode_operations contains the function permission | |
132 | dnl # and expects the nameidata structure to be passed. | |
133 | dnl # | |
134 | AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [ | |
135 | AC_MSG_CHECKING([whether iops->permission() wants nameidata]) | |
136 | ZFS_LINUX_TRY_COMPILE([ | |
137 | #include <linux/fs.h> | |
138 | ||
139 | int permission_fn(struct inode *inode, int mask, | |
140 | struct nameidata *nd) { return 0; } | |
141 | ||
142 | static const struct inode_operations | |
143 | iops __attribute__ ((unused)) = { | |
144 | .permission = permission_fn, | |
145 | }; | |
146 | ],[ | |
147 | ],[ | |
148 | AC_MSG_RESULT(yes) | |
149 | AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists]) | |
150 | AC_DEFINE(HAVE_PERMISSION_WITH_NAMEIDATA, 1, | |
151 | [iops->permission() with nameidata exists]) | |
152 | ],[ | |
153 | AC_MSG_RESULT(no) | |
154 | ]) | |
155 | ]) | |
156 | ||
157 | dnl # | |
158 | dnl # 2.6.32 API change, | |
159 | dnl # Check if inode_operations contains the function check_acl | |
160 | dnl # | |
161 | AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL], [ | |
162 | AC_MSG_CHECKING([whether iops->check_acl() exists]) | |
163 | ZFS_LINUX_TRY_COMPILE([ | |
164 | #include <linux/fs.h> | |
165 | ||
166 | int check_acl_fn(struct inode *inode, int mask) { return 0; } | |
167 | ||
168 | static const struct inode_operations | |
169 | iops __attribute__ ((unused)) = { | |
170 | .check_acl = check_acl_fn, | |
171 | }; | |
172 | ],[ | |
173 | ],[ | |
174 | AC_MSG_RESULT(yes) | |
175 | AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists]) | |
176 | ],[ | |
177 | AC_MSG_RESULT(no) | |
178 | ]) | |
179 | ]) | |
180 | ||
181 | dnl # | |
182 | dnl # 2.6.38 API change, | |
183 | dnl # The function check_acl gained a new parameter: flags | |
184 | dnl # | |
185 | AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS], [ | |
186 | AC_MSG_CHECKING([whether iops->check_acl() wants flags]) | |
187 | ZFS_LINUX_TRY_COMPILE([ | |
188 | #include <linux/fs.h> | |
189 | ||
190 | int check_acl_fn(struct inode *inode, int mask, | |
191 | unsigned int flags) { return 0; } | |
192 | ||
193 | static const struct inode_operations | |
194 | iops __attribute__ ((unused)) = { | |
195 | .check_acl = check_acl_fn, | |
196 | }; | |
197 | ],[ | |
198 | ],[ | |
199 | AC_MSG_RESULT(yes) | |
200 | AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists]) | |
201 | AC_DEFINE(HAVE_CHECK_ACL_WITH_FLAGS, 1, | |
202 | [iops->check_acl() wants flags]) | |
203 | ],[ | |
204 | AC_MSG_RESULT(no) | |
205 | ]) | |
206 | ]) | |
207 | ||
208 | dnl # | |
209 | dnl # 3.1 API change, | |
210 | dnl # Check if inode_operations contains the function get_acl | |
211 | dnl # | |
212 | AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [ | |
213 | AC_MSG_CHECKING([whether iops->get_acl() exists]) | |
214 | ZFS_LINUX_TRY_COMPILE([ | |
215 | #include <linux/fs.h> | |
216 | ||
217 | struct posix_acl *get_acl_fn(struct inode *inode, int type) | |
218 | { return NULL; } | |
219 | ||
220 | static const struct inode_operations | |
221 | iops __attribute__ ((unused)) = { | |
222 | .get_acl = get_acl_fn, | |
223 | }; | |
224 | ],[ | |
225 | ],[ | |
226 | AC_MSG_RESULT(yes) | |
227 | AC_DEFINE(HAVE_GET_ACL, 1, [iops->get_acl() exists]) | |
228 | ],[ | |
229 | AC_MSG_RESULT(no) | |
230 | ]) | |
231 | ]) | |
232 | ||
233 | dnl # | |
234 | dnl # 2.6.30 API change, | |
235 | dnl # current_umask exists only since this version. | |
236 | dnl # | |
237 | AC_DEFUN([ZFS_AC_KERNEL_CURRENT_UMASK], [ | |
238 | AC_MSG_CHECKING([whether current_umask exists]) | |
239 | ZFS_LINUX_TRY_COMPILE([ | |
240 | #include <linux/fs.h> | |
241 | ],[ | |
242 | current_umask(); | |
243 | ],[ | |
244 | AC_MSG_RESULT(yes) | |
245 | AC_DEFINE(HAVE_CURRENT_UMASK, 1, [current_umask() exists]) | |
246 | ],[ | |
247 | AC_MSG_RESULT(no) | |
248 | ]) | |
249 | ]) |