Move the initialization of the devmtx into the mutex_init() function

called during early init before cninit().

Tested on:	i386, alpha, sparc64
Reviewed by:	phk, imp
Reported by:	Divacky Roman xdivac02 at stud dot fit dot vutbr dot cz
MFC after:	1 week
This commit is contained in:
John Baldwin 2005-10-18 18:27:44 +00:00
parent c86b3a98fe
commit 8c4b6380c7
2 changed files with 4 additions and 2 deletions

View File

@ -57,8 +57,7 @@ static struct cdev *make_dev_credv(struct cdevsw *devsw, int minornr,
void
dev_lock(void)
{
if (!mtx_initialized(&devmtx))
mtx_init(&devmtx, "cdev", NULL, MTX_DEF);
mtx_lock(&devmtx);
}

View File

@ -67,6 +67,8 @@ __FBSDID("$FreeBSD$");
#include <ddb/ddb.h>
#include <fs/devfs/devfs_int.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
@ -900,5 +902,6 @@ mutex_init(void)
mtx_init(&Giant, "Giant", NULL, MTX_DEF | MTX_RECURSE);
mtx_init(&sched_lock, "sched lock", NULL, MTX_SPIN | MTX_RECURSE);
mtx_init(&proc0.p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
mtx_init(&devmtx, "cdev", NULL, MTX_DEF);
mtx_lock(&Giant);
}