Justin T. Gibbs 27c959cf05 Fix a couple of race conditions in devstat(9) initialization.
In devstat_new_entry(), there is no need to initialize the queue
and the mutex in this function.  There are ways to do static
initialization on both, so use STAILQ_HEAD_INITIALIZER and
MTX_SYSINIT to initialize the queue and the mutex.

In devstat_alloc(), use an atomic test and set routine to guard
making our entry in /dev.  Using just a plain static variable
creates a race condition on multiprocessor machines.  If you
attempt to create a second entry in devfs, the kernel will panic.

Submitted by:	kdm
Reviewed by:	gibbs
Sponsored by:	Spectra Logic Corporation
MFC after:	1 week.
2011-06-13 21:21:02 +00:00
..
MFC
2011-06-03 17:09:15 +00:00
2011-05-22 09:58:48 +00:00
MFC
2011-06-04 22:05:20 +00:00
MFC
2011-05-27 16:09:10 +00:00
2011-06-13 13:24:33 +00:00
2011-06-02 09:56:53 +00:00
2011-06-08 23:44:59 +00:00