diff options
author | Renato Botelho <renato@netgate.com> | 2015-09-22 07:24:31 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-09-22 07:24:31 -0300 |
commit | b5a91a37da44408c68a25426a16a8ca84686f054 (patch) | |
tree | 5761589f6059a9c8a3df1d4aed7e7972e6b1c431 /sys/kern/vfs_subr.c | |
parent | 8400c0790e456038fbca4995d032d4e3d44c3d31 (diff) | |
parent | 0f328f755ef12f6cb68a753ed5e48e934002a2b8 (diff) | |
download | FreeBSD-src-b5a91a37da44408c68a25426a16a8ca84686f054.zip FreeBSD-src-b5a91a37da44408c68a25426a16a8ca84686f054.tar.gz |
Merge branch 'stable/10' into devel
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 2c471af..a9e17f1 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -280,8 +280,25 @@ static enum { SYNCER_RUNNING, SYNCER_SHUTTING_DOWN, SYNCER_FINAL_DELAY } * XXX desiredvnodes is historical cruft and should not exist. */ 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, &wantfreevnodes, 0, "Minimum number of vnodes (legacy)"); static int vnlru_nowhere; |