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

Function racct_destroy_locked

freebsd/kern/kern_racct.c:468–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466}
467
468static void
469racct_destroy_locked(struct racct **racctp)
470{
471 struct racct *racct;
472 int i;
473
474 ASSERT_RACCT_ENABLED();
475
476 SDT_PROBE1(racct, , racct, destroy, racctp);
477
478 RACCT_LOCK_ASSERT();
479 KASSERT(racctp != NULL, ("NULL racctp"));
480 KASSERT(*racctp != NULL, ("NULL racct"));
481
482 racct = *racctp;
483
484 for (i = 0; i <= RACCT_MAX; i++) {
485 if (RACCT_IS_SLOPPY(i))
486 continue;
487 if (!RACCT_IS_RECLAIMABLE(i))
488 continue;
489 KASSERT(racct->r_resources[i] == 0,
490 ("destroying non-empty racct: "
491 "%ju allocated for resource %d\n",
492 racct->r_resources[i], i));
493 }
494 uma_zfree(racct_zone, racct);
495 *racctp = NULL;
496}
497
498void
499racct_destroy(struct racct **racct)

Callers 2

racct_destroyFunction · 0.85
racct_proc_exitFunction · 0.85

Calls 1

uma_zfreeFunction · 0.50

Tested by

no test coverage detected