mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Move mutex creation from ipf_log_soft_init() to ipf_log_soft_create()
to be consistent with mutex destruction in ipf_log_soft_destroy(). As a result mutex destruction in ipf_log_soft_fini() is redundant. Approved by: glebius (mentor) Obtained from: darrenr (author)
This commit is contained in:
parent
5688fa661b
commit
2182dc81ee
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=266605
@ -214,6 +214,7 @@ ipf_log_soft_create(softc)
|
||||
ipf_main_softc_t *softc;
|
||||
{
|
||||
ipf_log_softc_t *softl;
|
||||
int i;
|
||||
|
||||
KMALLOC(softl, ipf_log_softc_t *);
|
||||
if (softl == NULL)
|
||||
@ -234,6 +235,10 @@ ipf_log_soft_create(softc)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = IPL_LOGMAX; i >= 0; i--) {
|
||||
MUTEX_INIT(&softl->ipl_mutex[i], "ipf log mutex");
|
||||
}
|
||||
|
||||
softl->ipl_suppress = 1;
|
||||
softl->ipl_logall = 0;
|
||||
softl->ipl_log_init = 0;
|
||||
@ -267,13 +272,6 @@ ipf_log_soft_init(softc, arg)
|
||||
softl->iplog_ss[i].read_waiter = 0;
|
||||
softl->iplog_ss[i].state = 0;
|
||||
# endif
|
||||
# if defined(linux) && defined(_KERNEL)
|
||||
init_waitqueue_head(softl->iplh_linux + i);
|
||||
# endif
|
||||
# if SOLARIS && defined(_KERNEL)
|
||||
cv_init(&softl->ipl_wait[i], NULL, CV_DRIVER, NULL);
|
||||
# endif
|
||||
MUTEX_INIT(&softl->ipl_mutex[i], "ipf log mutex");
|
||||
}
|
||||
|
||||
|
||||
@ -324,7 +322,7 @@ ipf_log_soft_fini(softc, arg)
|
||||
# endif
|
||||
MUTEX_ENTER(&softl->ipl_mutex[i]);
|
||||
}
|
||||
MUTEX_DESTROY(&softl->ipl_mutex[i]);
|
||||
MUTEX_EXIT(&softl->ipl_mutex[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user