From 57034e740759febe61830aa21cffd7a733dd2b3c Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Mon, 8 Aug 1994 15:41:08 +0000 Subject: [PATCH] Run-time configuration of VFS update interval. Old UPDATE_INTERVAL configuration option is no longer supported. --- sys/kern/kern_sysctl.c | 16 +++++++++++++++- sys/kern/vfs_bio.c | 6 +----- sys/sys/sysctl.h | 6 ++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index c1308cdd1315..d9cd27c9e80e 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94 - * $Id: kern_sysctl.c,v 1.3 1994/08/02 07:42:19 davidg Exp $ + * $Id: kern_sysctl.c,v 1.4 1994/08/08 00:30:03 wollman Exp $ */ /* @@ -180,6 +180,8 @@ char domainname[MAXHOSTNAMELEN]; int domainnamelen; long hostid; int securelevel; +extern int vfs_update_wakeup; +extern int vfs_update_interval; /* * kernel related system variables. @@ -216,6 +218,18 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) return (sysctl_int(oldp, oldlenp, newp, newlen, &maxproc)); case KERN_MAXFILES: return (sysctl_int(oldp, oldlenp, newp, newlen, &maxfiles)); + case KERN_UPDATEINTERVAL: + /* + * NB: this simple-minded approach only works because + * `tsleep' takes a timeout argument of 0 as meaning + * `no timeout'. + */ + error = sysctl_int(oldp, oldlenp, newp, newlen, + &vfs_update_interval); + if(!error) { + wakeup(&vfs_update_wakeup); + } + return error; case KERN_ARGMAX: return (sysctl_rdint(oldp, oldlenp, newp, ARG_MAX)); case KERN_SECURELVL: diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 61a347612e1c..810e28d1371e 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -16,7 +16,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: vfs_bio.c,v 1.6 1994/08/06 09:15:28 davidg Exp $ + * $Id: vfs_bio.c,v 1.7 1994/08/07 14:53:20 davidg Exp $ */ #include @@ -646,11 +646,7 @@ count_lock_queue() return(count); } -#ifndef UPDATE_INTERVAL int vfs_update_interval = 30; -#else -int vfs_update_interval = UPDATE_INTERVAL; -#endif void vfs_update() { diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index e4e40bd48a45..590e579369f5 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)sysctl.h 8.1 (Berkeley) 6/2/93 - * $Id: sysctl.h,v 1.2 1994/08/02 07:53:41 davidg Exp $ + * $Id: sysctl.h,v 1.3 1994/08/08 00:30:12 wollman Exp $ */ #ifndef _SYS_SYSCTL_H_ @@ -129,7 +129,8 @@ struct ctlname { #define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */ #define KERN_BOOTTIME 21 /* struct: time kernel was booted */ #define KERN_DOMAINNAME 22 /* string: YP domain name */ -#define KERN_MAXID 23 /* number of valid kern ids */ +#define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */ +#define KERN_MAXID 24 /* number of valid kern ids */ #define CTL_KERN_NAMES { \ { 0, 0 }, \ @@ -155,6 +156,7 @@ struct ctlname { { "saved_ids", CTLTYPE_INT }, \ { "boottime", CTLTYPE_STRUCT }, \ { "domainname", CTLTYPE_STRING }, \ + { "update", CTLTYPE_INT }, \ } /*