svn commit: r367235 - head/sys/contrib/openzfs/include/os/freebsd/spl/sys

Brandon Bergren bdragon at FreeBSD.org
Sat Oct 31 21:11:35 UTC 2020


Author: bdragon
Date: Sat Oct 31 21:11:34 2020
New Revision: 367235
URL: https://svnweb.freebsd.org/changeset/base/367235

Log:
  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)

Modified:
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/atomic.h

Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/atomic.h
==============================================================================
--- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/atomic.h	Sat Oct 31 20:28:13 2020	(r367234)
+++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/atomic.h	Sat Oct 31 21:11:34 2020	(r367235)
@@ -188,6 +188,8 @@ atomic_cas_ptr(volatile void *target, void *cmp,  void
  */
 #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_ */


More information about the svn-src-all mailing list