Changeset View
Changeset View
Standalone View
Standalone View
sys/rpc/svc.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
* There are two sets of procedures here. The xprt routines are | * There are two sets of procedures here. The xprt routines are | ||||
* for handling transport handles. The svc routines handle the | * for handling transport handles. The svc routines handle the | ||||
* list of service routines. | * list of service routines. | ||||
* | * | ||||
* Copyright (C) 1984, Sun Microsystems, Inc. | * Copyright (C) 1984, Sun Microsystems, Inc. | ||||
*/ | */ | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/jail.h> | |||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/kthread.h> | #include <sys/kthread.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | svcpool_create(const char *name, struct sysctl_oid_list *sysctl_base) | ||||
* on LP64 architectures, so cast to u_long to avoid undefined | * on LP64 architectures, so cast to u_long to avoid undefined | ||||
* behavior. (ILP32 architectures cannot have nmbclusters | * behavior. (ILP32 architectures cannot have nmbclusters | ||||
* large enough to overflow for other reasons.) | * large enough to overflow for other reasons.) | ||||
*/ | */ | ||||
pool->sp_space_high = (u_long)nmbclusters * MCLBYTES / 4; | pool->sp_space_high = (u_long)nmbclusters * MCLBYTES / 4; | ||||
pool->sp_space_low = (pool->sp_space_high / 3) * 2; | pool->sp_space_low = (pool->sp_space_high / 3) * 2; | ||||
sysctl_ctx_init(&pool->sp_sysctl); | sysctl_ctx_init(&pool->sp_sysctl); | ||||
if (sysctl_base) { | if (!jailed(curthread->td_ucred) && sysctl_base) { | ||||
SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"minthreads", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, | "minthreads", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, | ||||
pool, 0, svcpool_minthread_sysctl, "I", | pool, 0, svcpool_minthread_sysctl, "I", | ||||
"Minimal number of threads"); | "Minimal number of threads"); | ||||
SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"maxthreads", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, | "maxthreads", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, | ||||
pool, 0, svcpool_maxthread_sysctl, "I", | pool, 0, svcpool_maxthread_sysctl, "I", | ||||
"Maximal number of threads"); | "Maximal number of threads"); | ||||
Show All 28 Lines | if (!jailed(curthread->td_ucred) && sysctl_base) { | ||||
SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"request_space_throttled", CTLFLAG_RD, | "request_space_throttled", CTLFLAG_RD, | ||||
&pool->sp_space_throttled, 0, | &pool->sp_space_throttled, 0, | ||||
"Whether nfs requests are currently throttled"); | "Whether nfs requests are currently throttled"); | ||||
SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, | SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, | ||||
"request_space_throttle_count", CTLFLAG_RD, | "request_space_throttle_count", CTLFLAG_RD, | ||||
&pool->sp_space_throttle_count, 0, | &pool->sp_space_throttle_count, 0, | ||||
"Count of times throttling based on request space has occurred"); | "Count of times throttling based on request space has occurred"); | ||||
bz: This will hide the sysctls from the vnet jails as opposed to make them read-only but available? | |||||
Done Inline ActionsYea, I wasn't sure what to do with these. I did it this way because I didn't know how to rmacklem: Yea, I wasn't sure what to do with these.
They are in the krpc, so really don't apply to nfs… | |||||
} | } | ||||
return pool; | return pool; | ||||
} | } | ||||
/* | /* | ||||
* Code common to svcpool_destroy() and svcpool_close(), which cleans up | * Code common to svcpool_destroy() and svcpool_close(), which cleans up | ||||
* the pool data structures. | * the pool data structures. | ||||
▲ Show 20 Lines • Show All 1,300 Lines • Show Last 20 Lines |
This will hide the sysctls from the vnet jails as opposed to make them read-only but available? Which version do we really need?