Changeset View
Changeset View
Standalone View
Standalone View
stable/10/sys/kern/vfs_subr.c
Show First 20 Lines • Show All 274 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Number of vnodes we want to exist at any one time. This is mostly used | * Number of vnodes we want to exist at any one time. This is mostly used | ||||
* to size hash tables in vnode-related code. It is normally not used in | * to size hash tables in vnode-related code. It is normally not used in | ||||
* getnewvnode(), as wantfreevnodes is normally nonzero.) | * getnewvnode(), as wantfreevnodes is normally nonzero.) | ||||
* | * | ||||
* XXX desiredvnodes is historical cruft and should not exist. | * XXX desiredvnodes is historical cruft and should not exist. | ||||
*/ | */ | ||||
int desiredvnodes; | int desiredvnodes; | ||||
SYSCTL_INT(_kern, KERN_MAXVNODES, maxvnodes, CTLFLAG_RW, | |||||
&desiredvnodes, 0, "Maximum number of vnodes"); | static int | ||||
sysctl_update_desiredvnodes(SYSCTL_HANDLER_ARGS) | |||||
{ | |||||
int error, old_desiredvnodes; | |||||
old_desiredvnodes = desiredvnodes; | |||||
if ((error = sysctl_handle_int(oidp, arg1, arg2, req)) != 0) | |||||
return (error); | |||||
if (old_desiredvnodes != desiredvnodes) { | |||||
vfs_hash_changesize(desiredvnodes); | |||||
cache_changesize(desiredvnodes); | |||||
} | |||||
return (0); | |||||
} | |||||
SYSCTL_PROC(_kern, KERN_MAXVNODES, maxvnodes, | |||||
CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, &desiredvnodes, 0, | |||||
sysctl_update_desiredvnodes, "I", "Maximum number of vnodes"); | |||||
SYSCTL_ULONG(_kern, OID_AUTO, minvnodes, CTLFLAG_RW, | SYSCTL_ULONG(_kern, OID_AUTO, minvnodes, CTLFLAG_RW, | ||||
&wantfreevnodes, 0, "Minimum number of vnodes (legacy)"); | &wantfreevnodes, 0, "Minimum number of vnodes (legacy)"); | ||||
static int vnlru_nowhere; | static int vnlru_nowhere; | ||||
SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW, | SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW, | ||||
&vnlru_nowhere, 0, "Number of times the vnlru process ran without success"); | &vnlru_nowhere, 0, "Number of times the vnlru process ran without success"); | ||||
/* Shift count for (uintptr_t)vp to initialize vp->v_hash. */ | /* Shift count for (uintptr_t)vp to initialize vp->v_hash. */ | ||||
static int vnsz2log; | static int vnsz2log; | ||||
▲ Show 20 Lines • Show All 4,598 Lines • Show Last 20 Lines |