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

Function rctl_racct_remove_rules

freebsd/kern/kern_rctl.c:929–949  ·  view source on GitHub ↗

* Remove limits for a rules matching the filter and release * the refcounts for the rules, possibly freeing them. Returns * the number of limit structures removed. */

Source from the content-addressed store, hash-verified

927 * the number of limit structures removed.
928 */
929static int
930rctl_racct_remove_rules(struct racct *racct,
931 const struct rctl_rule *filter)
932{
933 struct rctl_rule_link *link, *linktmp;
934 int removed = 0;
935
936 ASSERT_RACCT_ENABLED();
937 RACCT_LOCK_ASSERT();
938
939 LIST_FOREACH_SAFE(link, &racct->r_rule_links, rrl_next, linktmp) {
940 if (!rctl_rule_matches(link->rrl_rule, filter))
941 continue;
942
943 LIST_REMOVE(link, rrl_next);
944 rctl_rule_release(link->rrl_rule);
945 uma_zfree(rctl_rule_link_zone, link);
946 removed++;
947 }
948 return (removed);
949}
950
951static void
952rctl_rule_acquire_subject(struct rctl_rule *rule)

Callers 2

rctl_rule_removeFunction · 0.85

Calls 3

rctl_rule_matchesFunction · 0.85
rctl_rule_releaseFunction · 0.85
uma_zfreeFunction · 0.50

Tested by

no test coverage detected