diff options
author | Tony Hutter <[email protected]> | 2018-02-22 09:02:06 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-02-22 09:02:06 -0800 |
commit | a5369b61a24cf75d8188af8ee554123cf7fae14c (patch) | |
tree | 66ef630cb10c474df00353b48532963f3d3dbb73 /config/kernel-acl-refcount.m4 | |
parent | f8478fc2ca8d62f9562a4284426e8d3bd41c0cf0 (diff) |
Linux 4.16 compat: use correct *_dec_and_test()
Use refcount_dec_and_test() on 4.16+ kernels, atomic_dec_and_test()
on older kernels. https://lwn.net/Articles/714974/
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Closes: #7179
Closes: #7211
Diffstat (limited to 'config/kernel-acl-refcount.m4')
-rw-r--r-- | config/kernel-acl-refcount.m4 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/config/kernel-acl-refcount.m4 b/config/kernel-acl-refcount.m4 new file mode 100644 index 000000000..43e3c442d --- /dev/null +++ b/config/kernel-acl-refcount.m4 @@ -0,0 +1,20 @@ +dnl # +dnl # 4.16 kernel: check if struct posix_acl acl.a_refcount is a refcount_t. +dnl # It's an atomic_t on older kernels. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_ACL_HAS_REFCOUNT], [ + AC_MSG_CHECKING([whether posix_acl has refcount_t]) + ZFS_LINUX_TRY_COMPILE([ + #include <linux/backing-dev.h> + #include <linux/refcount.h> + #include <linux/posix_acl.h> + ],[ + struct posix_acl acl; + refcount_t *r __attribute__ ((unused)) = &acl.a_refcount; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_ACL_REFCOUNT, 1, [posix_acl has refcount_t]) + ],[ + AC_MSG_RESULT(no) + ]) +]) |