diff options
author | Tony Hutter <[email protected]> | 2018-02-22 09:02:06 -0800 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2018-03-14 16:10:37 -0700 |
commit | e5ba614d05bde1e98ba46d5b75cf6b8a0701c2ca (patch) | |
tree | 150a63628372805d3ae840ff2d01bd2887fcfca7 /include | |
parent | 30ac8de48a2bb680e15dfe8879faaa7b461b771c (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 'include')
-rw-r--r-- | include/linux/vfs_compat.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/vfs_compat.h b/include/linux/vfs_compat.h index 7fcf3c055..6347268af 100644 --- a/include/linux/vfs_compat.h +++ b/include/linux/vfs_compat.h @@ -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 */ |