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

Function rctl_racct_add_rule

freebsd/kern/kern_rctl.c:885–901  ·  view source on GitHub ↗

* Connect the rule to the racct, increasing refcount for the rule. */

Source from the content-addressed store, hash-verified

883 * Connect the rule to the racct, increasing refcount for the rule.
884 */
885static void
886rctl_racct_add_rule(struct racct *racct, struct rctl_rule *rule)
887{
888 struct rctl_rule_link *link;
889
890 ASSERT_RACCT_ENABLED();
891 KASSERT(rctl_rule_fully_specified(rule), ("rule not fully specified"));
892
893 rctl_rule_acquire(rule);
894 link = uma_zalloc(rctl_rule_link_zone, M_WAITOK);
895 link->rrl_rule = rule;
896 link->rrl_exceeded = 0;
897
898 RACCT_LOCK();
899 LIST_INSERT_HEAD(&racct->r_rule_links, link, rrl_next);
900 RACCT_UNLOCK();
901}
902
903static int
904rctl_racct_add_rule_locked(struct racct *racct, struct rctl_rule *rule)

Callers 1

rctl_rule_addFunction · 0.85

Calls 3

rctl_rule_acquireFunction · 0.85
uma_zallocFunction · 0.50

Tested by

no test coverage detected