| 1082 | } |
| 1083 | |
| 1084 | void |
| 1085 | rctl_rule_release(struct rctl_rule *rule) |
| 1086 | { |
| 1087 | |
| 1088 | ASSERT_RACCT_ENABLED(); |
| 1089 | KASSERT(rule->rr_refcount > 0, ("rule->rr_refcount <= 0")); |
| 1090 | |
| 1091 | if (refcount_release(&rule->rr_refcount)) { |
| 1092 | /* |
| 1093 | * rctl_rule_release() is often called when iterating |
| 1094 | * over all the uidinfo structures in the system, |
| 1095 | * holding uihashtbl_lock. Since rctl_rule_free() |
| 1096 | * might end up calling uifree(), this would lead |
| 1097 | * to lock recursion. Use taskqueue to avoid this. |
| 1098 | */ |
| 1099 | TASK_INIT(&rule->rr_task, 0, rctl_rule_free, rule); |
| 1100 | taskqueue_enqueue(taskqueue_thread, &rule->rr_task); |
| 1101 | } |
| 1102 | } |
| 1103 | |
| 1104 | static int |
| 1105 | rctl_rule_fully_specified(const struct rctl_rule *rule) |
no test coverage detected