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

Function fail_point_destroy

freebsd/kern/kern_fail.c:518–537  ·  view source on GitHub ↗

* Free the resources held by a fail_point, and wake any paused threads. * Thou shalt not allow threads to hit this fail point after you enter this * function, nor shall you call this multiple times for a given fp. * @ingroup failpoint */

Source from the content-addressed store, hash-verified

516 * @ingroup failpoint
517 */
518void
519fail_point_destroy(struct fail_point *fp)
520{
521
522 fail_point_drain(fp, 0);
523
524 if ((fp->fp_flags & FAIL_POINT_DYNAMIC_NAME) != 0) {
525 fp_free(__DECONST(void *, fp->fp_name));
526 fp->fp_name = NULL;
527 }
528 fp->fp_flags = 0;
529 if (fp->fp_callout) {
530 fp_free(fp->fp_callout);
531 fp->fp_callout = NULL;
532 }
533
534 sx_xlock(&sx_fp_set);
535 fail_point_garbage_collect();
536 sx_xunlock(&sx_fp_set);
537}
538
539/**
540 * This does the real work of evaluating a fail point. If the fail point tells

Callers

nothing calls this directly

Calls 2

fail_point_drainFunction · 0.85

Tested by

no test coverage detected