-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <dinatale2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes: #7179 Closes: #7211
- Loading branch information
1 parent
f8478fc
commit a5369b6
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters