Initialize loginclass mutex using MTX_SYSINIT instead of using SI_SUB_CPU.

Suggested by:	rwatson@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2014-05-14 09:03:02 +00:00
parent a3837e481c
commit fbaadda60b

View File

@ -69,9 +69,7 @@ LIST_HEAD(, loginclass) loginclasses;
* Lock protecting loginclasses list.
*/
static struct mtx loginclasses_lock;
static void lc_init(void);
SYSINIT(loginclass, SI_SUB_CPU, SI_ORDER_FIRST, lc_init, NULL);
MTX_SYSINIT(loginclasses_init, &loginclasses_lock, "loginclasses lock", MTX_DEF);
void
loginclass_hold(struct loginclass *lc)
@ -229,10 +227,3 @@ loginclass_racct_foreach(void (*callback)(struct racct *racct,
(callback)(lc->lc_racct, arg2, arg3);
mtx_unlock(&loginclasses_lock);
}
static void
lc_init(void)
{
mtx_init(&loginclasses_lock, "loginclasses lock", NULL, MTX_DEF);
}