Remove unused mtx_lock_giant(), mtx_unlock_giant(), related globals
and sysctls.
This commit is contained in:
parent
757ed3b591
commit
f949f795aa
@ -989,46 +989,3 @@ mutex_init(void)
|
||||
mtx_init(&proc0.p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
|
||||
mtx_lock(&Giant);
|
||||
}
|
||||
|
||||
/*
|
||||
* Encapsulated Giant mutex routines. These routines provide encapsulation
|
||||
* control for the Giant mutex, allowing sysctls to be used to turn on and
|
||||
* off Giant around certain subsystems. The default value for the sysctls
|
||||
* are set to what developers believe is stable and working in regards to
|
||||
* the Giant pushdown. Developers should not turn off Giant via these
|
||||
* sysctls unless they know what they are doing.
|
||||
*
|
||||
* Callers of mtx_lock_giant() are expected to pass the return value to an
|
||||
* accompanying mtx_unlock_giant() later on. If multiple subsystems are
|
||||
* effected by a Giant wrap, all related sysctl variables must be zero for
|
||||
* the subsystem call to operate without Giant (as determined by the caller).
|
||||
*/
|
||||
|
||||
SYSCTL_NODE(_kern, OID_AUTO, giant, CTLFLAG_RD, NULL, "Giant mutex manipulation");
|
||||
|
||||
static int kern_giant_all = 0;
|
||||
SYSCTL_INT(_kern_giant, OID_AUTO, all, CTLFLAG_RW, &kern_giant_all, 0, "");
|
||||
|
||||
int kern_giant_proc = 1; /* Giant around PROC locks */
|
||||
int kern_giant_file = 1; /* Giant around struct file & filedesc */
|
||||
int kern_giant_ucred = 1; /* Giant around ucred */
|
||||
SYSCTL_INT(_kern_giant, OID_AUTO, proc, CTLFLAG_RW, &kern_giant_proc, 0, "");
|
||||
SYSCTL_INT(_kern_giant, OID_AUTO, file, CTLFLAG_RW, &kern_giant_file, 0, "");
|
||||
SYSCTL_INT(_kern_giant, OID_AUTO, ucred, CTLFLAG_RW, &kern_giant_ucred, 0, "");
|
||||
|
||||
int
|
||||
mtx_lock_giant(int sysctlvar)
|
||||
{
|
||||
if (sysctlvar || kern_giant_all) {
|
||||
mtx_lock(&Giant);
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void
|
||||
mtx_unlock_giant(int s)
|
||||
{
|
||||
if (s)
|
||||
mtx_unlock(&Giant);
|
||||
}
|
||||
|
@ -989,46 +989,3 @@ mutex_init(void)
|
||||
mtx_init(&proc0.p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
|
||||
mtx_lock(&Giant);
|
||||
}
|
||||
|
||||
/*
|
||||
* Encapsulated Giant mutex routines. These routines provide encapsulation
|
||||
* control for the Giant mutex, allowing sysctls to be used to turn on and
|
||||
* off Giant around certain subsystems. The default value for the sysctls
|
||||
* are set to what developers believe is stable and working in regards to
|
||||
* the Giant pushdown. Developers should not turn off Giant via these
|
||||
* sysctls unless they know what they are doing.
|
||||
*
|
||||
* Callers of mtx_lock_giant() are expected to pass the return value to an
|
||||
* accompanying mtx_unlock_giant() later on. If multiple subsystems are
|
||||
* effected by a Giant wrap, all related sysctl variables must be zero for
|
||||
* the subsystem call to operate without Giant (as determined by the caller).
|
||||
*/
|
||||
|
||||
SYSCTL_NODE(_kern, OID_AUTO, giant, CTLFLAG_RD, NULL, "Giant mutex manipulation");
|
||||
|
||||
static int kern_giant_all = 0;
|
||||
SYSCTL_INT(_kern_giant, OID_AUTO, all, CTLFLAG_RW, &kern_giant_all, 0, "");
|
||||
|
||||
int kern_giant_proc = 1; /* Giant around PROC locks */
|
||||
int kern_giant_file = 1; /* Giant around struct file & filedesc */
|
||||
int kern_giant_ucred = 1; /* Giant around ucred */
|
||||
SYSCTL_INT(_kern_giant, OID_AUTO, proc, CTLFLAG_RW, &kern_giant_proc, 0, "");
|
||||
SYSCTL_INT(_kern_giant, OID_AUTO, file, CTLFLAG_RW, &kern_giant_file, 0, "");
|
||||
SYSCTL_INT(_kern_giant, OID_AUTO, ucred, CTLFLAG_RW, &kern_giant_ucred, 0, "");
|
||||
|
||||
int
|
||||
mtx_lock_giant(int sysctlvar)
|
||||
{
|
||||
if (sysctlvar || kern_giant_all) {
|
||||
mtx_lock(&Giant);
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void
|
||||
mtx_unlock_giant(int s)
|
||||
{
|
||||
if (s)
|
||||
mtx_unlock(&Giant);
|
||||
}
|
||||
|
@ -114,8 +114,6 @@ void _mtx_unlock_spin_flags(struct mtx *m, int opts, const char *file,
|
||||
#ifdef INVARIANT_SUPPORT
|
||||
void _mtx_assert(struct mtx *m, int what, const char *file, int line);
|
||||
#endif
|
||||
int mtx_lock_giant(int sysctlvar);
|
||||
void mtx_unlock_giant(int s);
|
||||
|
||||
/*
|
||||
* We define our machine-independent (unoptimized) mutex micro-operations
|
||||
@ -290,13 +288,6 @@ extern int mtx_pool_valid;
|
||||
extern struct mtx sched_lock;
|
||||
extern struct mtx Giant;
|
||||
|
||||
/*
|
||||
* Giant lock sysctl variables used by other modules
|
||||
*/
|
||||
extern int kern_giant_proc;
|
||||
extern int kern_giant_file;
|
||||
extern int kern_giant_ucred;
|
||||
|
||||
/*
|
||||
* Giant lock manipulation and clean exit macros.
|
||||
* Used to replace return with an exit Giant and return.
|
||||
|
Loading…
x
Reference in New Issue
Block a user