svn commit: r324756 - in stable/11/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs

Ian Lepore ian at FreeBSD.org
Thu Oct 19 16:16:28 UTC 2017


Author: ian
Date: Thu Oct 19 16:16:26 2017
New Revision: 324756
URL: https://svnweb.freebsd.org/changeset/base/324756

Log:
  MFC r323985:
  
  Use nstosbt() instead of multiplying by SBT_1NS to avoid roundoff errors.
  
  Differential Revision:	https://reviews.freebsd.org/D11779

Modified:
  stable/11/sys/cddl/compat/opensolaris/sys/kcondvar.h
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/compat/opensolaris/sys/kcondvar.h
==============================================================================
--- stable/11/sys/cddl/compat/opensolaris/sys/kcondvar.h	Thu Oct 19 16:07:57 2017	(r324755)
+++ stable/11/sys/cddl/compat/opensolaris/sys/kcondvar.h	Thu Oct 19 16:16:26 2017	(r324756)
@@ -63,13 +63,8 @@ static clock_t
 cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res,
     int flag)
 {
-	sbintime_t sbt;
-	sbintime_t pr;
 
-	sbt = tim * SBT_1NS;
-	pr = res * SBT_1NS;
-
-	return (cv_timedwait_sbt(cvp, mp, sbt, pr, 0));
+	return (cv_timedwait_sbt(cvp, mp, nstosbt(tim), nstosbt(res), 0));
 }
 
 #endif	/* _KERNEL */

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c	Thu Oct 19 16:07:57 2017	(r324755)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c	Thu Oct 19 16:16:26 2017	(r324756)
@@ -806,8 +806,8 @@ dmu_tx_delay(dmu_tx_t *tx, uint64_t dirty)
 		continue;
 	mutex_exit(&curthread->t_delay_lock);
 #else
-	pause_sbt("dmu_tx_delay", wakeup * SBT_1NS,
-	    zfs_delay_resolution_ns * SBT_1NS, C_ABSOLUTE);
+	pause_sbt("dmu_tx_delay", nstosbt(wakeup),
+	    nstosbt(zfs_delay_resolution_ns), C_ABSOLUTE);
 #endif
 #else
 	hrtime_t delta = wakeup - gethrtime();


More information about the svn-src-all mailing list