mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-18 22:15:46 +01:00
Use nstosbt() instead of multiplying by SBT_1NS to avoid roundoff errors.
Differential Revision: https://reviews.freebsd.org/D11779
This commit is contained in:
parent
40c2a6da0d
commit
a78b4d1462
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323985
@ -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 */
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user