MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fail_point_use_timeout_path

Function fail_point_use_timeout_path

freebsd/sys/fail.h:163–179  ·  view source on GitHub ↗

* If the FAIL_POINT_USE_TIMEOUT flag is set on a failpoint, then * FAIL_POINT_SLEEP will result in a call to callout_reset 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. */

Source from the content-addressed store, hash-verified

161 * set fp_post_sleep_fn or an error will occur upon waking.
162 */
163static inline void
164fail_point_use_timeout_path(struct fail_point *fp, bool use_timeout,
165 void (*post_sleep_fn)(void *))
166{
167 KASSERT(!use_timeout || post_sleep_fn != NULL ||
168 (post_sleep_fn == NULL && fp->fp_post_sleep_fn != NULL),
169 ("Setting fp to use timeout, but not setting post_sleep_fn\n"));
170
171 if (use_timeout) {
172 fail_point_alloc_callout(fp);
173 fp->fp_flags |= FAIL_POINT_USE_TIMEOUT_PATH;
174 } else
175 fp->fp_flags &= ~FAIL_POINT_USE_TIMEOUT_PATH;
176
177 if (post_sleep_fn != NULL)
178 fp->fp_post_sleep_fn = post_sleep_fn;
179}
180
181/**
182 * Free the resources used by a fail-point. Pair with fail_point_init().

Callers

nothing calls this directly

Calls 1

fail_point_alloc_calloutFunction · 0.85

Tested by

no test coverage detected