FreeBSD/sys/sys/fail.h
/**
 * If the FAIL_POINT_USE_TIMEOUT flag is set on a failpoint, then
 * FAIL_POINT_SLEEP will result in a call to timeout instead of
 * msleep. Note that if you sleep while this flag is set, you must
 * set fp_post_sleep_fn or an error will occur upon waking.
 */
If the FAIL_POINT_USE_TIMEOUT flag is set on a failpoint, then
FAIL_POINT_SLEEP will result in a call to timeout instead of
msleep. Note that if you sleep while this flag is set, you must
set fp_post_sleep_fn or an error will occur upon waking.
If the FAIL_POINT_USE_TIMEOUT flag is set on a failpoint then FAIL_POINT_SLEEP will result in a call to timeout instead of msleep . Note that if you sleep while this flag is set you must set fp_post_sleep_fn or an error will occur upon waking .
static inline void
fail_point_use_timeout_path(struct fail_point *fp, bool use_timeout,
        void (*post_sleep_fn)(void *))
{
	KASSERT(!use_timeout || post_sleep_fn != NULL ||
	        (post_sleep_fn == NULL && fp->fp_post_sleep_fn != NULL),
	        ("Setting fp to use timeout, but not setting post_sleep_fn\n"));
	if (use_timeout)
		fp->fp_flags |= FAIL_POINT_USE_TIMEOUT_PATH;
	else
		fp->fp_flags &= ~FAIL_POINT_USE_TIMEOUT_PATH;
	if (post_sleep_fn != NULL)
		fp->fp_post_sleep_fn = post_sleep_fn;
}
static inline void fail_point_use_timeout_path ( struct fail_point * fp , bool use_timeout , void ( * post_sleep_fn ) ( void * ) ) { KASSERT ( ! use_timeout || post_sleep_fn != NULL || ( post_sleep_fn == NULL && fp -> fp_post_sleep_fn != NULL ) , ( " \n " ) ) ; if ( use_timeout ) fp -> fp_flags |= FAIL_POINT_USE_TIMEOUT_PATH ; else fp -> fp_flags &= ~ FAIL_POINT_USE_TIMEOUT_PATH ; if ( post_sleep_fn != NULL ) fp -> fp_post_sleep_fn = post_sleep_fn ; }
If the FAIL_POINT_USE_TIMEOUT flag is set on a failpoint, then
 FAIL_POINT_SLEEP will result in a call to timeout instead of
 msleep.
If the FAIL_POINT_USE_TIMEOUT flag is set on a failpoint then FAIL_POINT_SLEEP will result in a call to timeout instead of msleep .