mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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
This commit is contained in:
@@ -288,9 +288,13 @@ zpl_posix_acl_release(struct posix_acl *acl)
|
||||
{
|
||||
if ((acl == NULL) || (acl == ACL_NOT_CACHED))
|
||||
return;
|
||||
|
||||
#ifdef HAVE_ACL_REFCOUNT
|
||||
if (refcount_dec_and_test(&acl->a_refcount))
|
||||
zpl_posix_acl_release_impl(acl);
|
||||
#else
|
||||
if (atomic_dec_and_test(&acl->a_refcount))
|
||||
zpl_posix_acl_release_impl(acl);
|
||||
#endif
|
||||
}
|
||||
#endif /* HAVE_POSIX_ACL_RELEASE */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user