* 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. */
| 161 | * set fp_post_sleep_fn or an error will occur upon waking. |
| 162 | */ |
| 163 | static inline void |
| 164 | fail_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(). |
nothing calls this directly
no test coverage detected