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

Function LIST_HEAD

freebsd/kern/kern_loginclass.c:66–94  ·  view source on GitHub ↗
(, loginclass)

Source from the content-addressed store, hash-verified

64#include <sys/systm.h>
65
66static MALLOC_DEFINE(M_LOGINCLASS, "loginclass", "loginclass structures");
67
68LIST_HEAD(, loginclass) loginclasses;
69
70/*
71 * Lock protecting loginclasses list.
72 */
73static struct rwlock loginclasses_lock;
74RW_SYSINIT(loginclasses_init, &loginclasses_lock, "loginclasses lock");
75
76void
77loginclass_hold(struct loginclass *lc)
78{
79
80 refcount_acquire(&lc->lc_refcount);
81}
82
83void
84loginclass_free(struct loginclass *lc)
85{
86
87 if (refcount_release_if_not_last(&lc->lc_refcount))
88 return;
89
90 rw_wlock(&loginclasses_lock);
91 if (!refcount_release(&lc->lc_refcount)) {
92 rw_wunlock(&loginclasses_lock);
93 return;
94 }
95
96 racct_destroy(&lc->lc_racct);
97 LIST_REMOVE(lc, lc_next);

Callers 15

in_var.hFile · 0.85
_callout.hFile · 0.85
unpcb.hFile · 0.85
cpuset.hFile · 0.85
nd6.hFile · 0.85
uma_int.hFile · 0.85
spl_zone.cFile · 0.85
spl_slab_reclaimFunction · 0.85
spl-taskq.cFile · 0.85
ccpriv.hFile · 0.85
pf_if.cFile · 0.85
mac_internal.hFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected