Lines Matching refs:lc
72 loginclass_hold(struct loginclass *lc) in loginclass_hold() argument
75 refcount_acquire(&lc->lc_refcount); in loginclass_hold()
79 loginclass_free(struct loginclass *lc) in loginclass_free() argument
82 if (refcount_release_if_not_last(&lc->lc_refcount)) in loginclass_free()
86 if (!refcount_release(&lc->lc_refcount)) { in loginclass_free()
91 racct_destroy(&lc->lc_racct); in loginclass_free()
92 LIST_REMOVE(lc, lc_next); in loginclass_free()
95 free(lc, M_LOGINCLASS); in loginclass_free()
106 struct loginclass *lc; in loginclass_lookup() local
109 LIST_FOREACH(lc, &loginclasses, lc_next) in loginclass_lookup()
110 if (strcmp(name, lc->lc_name) == 0) { in loginclass_lookup()
111 loginclass_hold(lc); in loginclass_lookup()
115 return (lc); in loginclass_lookup()
128 struct loginclass *lc, *new_lc; in loginclass_find() local
133 lc = curthread->td_ucred->cr_loginclass; in loginclass_find()
134 if (strcmp(name, lc->lc_name) == 0) { in loginclass_find()
135 loginclass_hold(lc); in loginclass_find()
136 return (lc); in loginclass_find()
140 lc = loginclass_lookup(name); in loginclass_find()
142 if (lc != NULL) in loginclass_find()
143 return (lc); in loginclass_find()
156 if ((lc = loginclass_lookup(name)) == NULL) { in loginclass_find()
159 lc = new_lc; in loginclass_find()
166 return (lc); in loginclass_find()
182 struct loginclass *lc; in sys_getloginclass() local
185 lc = td->td_ucred->cr_loginclass; in sys_getloginclass()
186 lcnamelen = strlen(lc->lc_name) + 1; in sys_getloginclass()
189 return (copyout(lc->lc_name, uap->namebuf, lcnamelen)); in sys_getloginclass()
246 struct loginclass *lc; in loginclass_racct_foreach() local
251 LIST_FOREACH(lc, &loginclasses, lc_next) in loginclass_racct_foreach() local
252 (callback)(lc->lc_racct, arg2, arg3); in loginclass_racct_foreach()