Fix 32-bit build after r367229.

The use of atomic_sub_64() in zfs_zstd.c was breaking the 32-bit build on
platforms without native 64-bit atomics due to atomic_sub_64() not being
available, and no fallback being provided in _STANDALONE.

Provide a standalone stub to match atomic_add_64() using simple math.

While this is not actually atomic, it does not matter in libsa context,
since it always runs single-threaded and does not run under a scheduler.

Reviewed by: mjg (in email)
This commit is contained in:
Brandon Bergren 2020-10-31 21:11:34 +00:00
parent 59402cc58a
commit bd5e074531
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367235

View File

@ -188,6 +188,8 @@ atomic_cas_ptr(volatile void *target, void *cmp, void *newval)
*/
#undef atomic_add_64
#define atomic_add_64(ptr, val) *(ptr) += val
#undef atomic_sub_64
#define atomic_sub_64(ptr, val) *(ptr) -= val
#endif /* !_STANDALONE */
#endif /* !_OPENSOLARIS_SYS_ATOMIC_H_ */