mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Instead of using an atomic operation to determine whether the devstat(9)
device node has been created, pass MAKEDEV_CHECKNAME in so that the devfs code will do the check. Use a regular static variable as before, that's good enough to keep us from calling into devfs most of the time. Suggested by: kib MFC after: 1 week Sponsored by: Spectra Logic Corporation
This commit is contained in:
parent
27c959cf05
commit
094efe753d
1 changed files with 5 additions and 3 deletions
|
|
@ -470,9 +470,11 @@ devstat_alloc(void)
|
|||
static int once;
|
||||
|
||||
mtx_assert(&devstat_mutex, MA_NOTOWNED);
|
||||
if (!once && atomic_cmpset_int(&once, 0, 1)) {
|
||||
make_dev_credf(MAKEDEV_ETERNAL, &devstat_cdevsw, 0, NULL,
|
||||
UID_ROOT, GID_WHEEL, 0400, DEVSTAT_DEVICE_NAME);
|
||||
if (!once) {
|
||||
make_dev_credf(MAKEDEV_ETERNAL | MAKEDEV_CHECKNAME,
|
||||
&devstat_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0400,
|
||||
DEVSTAT_DEVICE_NAME);
|
||||
once = 1;
|
||||
}
|
||||
spp2 = NULL;
|
||||
mtx_lock(&devstat_mutex);
|
||||
|
|
|
|||
Loading…
Reference in a new issue