Index: sys/cddl/compat/opensolaris/sys/systm.h =================================================================== --- sys/cddl/compat/opensolaris/sys/systm.h +++ sys/cddl/compat/opensolaris/sys/systm.h @@ -42,9 +42,6 @@ #define delay(x) pause("soldelay", (x)) -#define timeout_generic(type, fn, arg, t, r, f) \ - timeout(fn, arg, t / (NANOSEC/hz) + 1) - #endif /* _KERNEL */ #endif /* _OPENSOLARIS_SYS_SYSTM_H_ */ Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h @@ -474,6 +474,9 @@ #ifdef __FreeBSD__ struct bio *io_bio; +#ifdef _KERNEL + struct callout io_timer; +#endif #endif /* Internal pipeline state */ Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c @@ -659,6 +659,9 @@ mutex_init(&zio->io_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&zio->io_cv, NULL, CV_DEFAULT, NULL); +#if defined(__FreeBSD__) && defined(_KERNEL) + callout_init(&zio->io_timer, 1); +#endif list_create(&zio->io_parent_list, sizeof (zio_link_t), offsetof(zio_link_t, zl_parent_node)); @@ -726,6 +729,10 @@ static void zio_destroy(zio_t *zio) { +#ifdef __FreeBSD__ + KASSERT(!(callout_active(&zio->io_timer) || + callout_pending(&zio->io_timer)), ("zio_destroy: timer active")); +#endif metaslab_trace_fini(&zio->io_alloc_list); list_destroy(&zio->io_parent_list); list_destroy(&zio->io_child_list); @@ -1710,8 +1717,13 @@ DTRACE_PROBE3(zio__delay__hit, zio_t *, zio, hrtime_t, now, hrtime_t, diff); +#ifdef __FreeBSD__ + callout_reset_sbt(&zio->io_timer, nstosbt(diff), 0, + (void (*)(void *))zio_interrupt, zio, C_HARDCLOCK); +#else (void) timeout_generic(CALLOUT_NORMAL, (void (*)(void *))zio_interrupt, zio, diff, 1, 0); +#endif } return;