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_ */
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to