Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Oct 2020 21:11:34 +0000 (UTC)
From:      Brandon Bergren <bdragon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r367235 - head/sys/contrib/openzfs/include/os/freebsd/spl/sys
Message-ID:  <202010312111.09VLBY8b012718@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010312111.09VLBY8b012718>