Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/nfs Auto-adjusting vfs.nfs.iothreads: when mounting the ...



details:   https://anonhg.NetBSD.org/src/rev/15389c06d68f
branches:  trunk
changeset: 485844:15389c06d68f
user:      tsarna <tsarna%NetBSD.org@localhost>
date:      Sun May 07 01:38:36 2000 +0000

description:
Auto-adjusting vfs.nfs.iothreads: when mounting the first nfs
filesystem, if the number of threads is "-1", meaning it's never been
set, then set it to 4.  You can override by setting this to some other
number (including 0) before or after mounting, of course.

Thanks to whoever it was that suggested this on ICB... sorry I don't
remember who.

diffstat:

 sys/nfs/nfs_syscalls.c |   7 ++++---
 sys/nfs/nfs_vfsops.c   |  12 +++++++++++-
 2 files changed, 15 insertions(+), 4 deletions(-)

diffs (54 lines):

diff -r bd10c6a98768 -r 15389c06d68f sys/nfs/nfs_syscalls.c
--- a/sys/nfs/nfs_syscalls.c    Sun May 07 01:38:15 2000 +0000
+++ b/sys/nfs/nfs_syscalls.c    Sun May 07 01:38:36 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_syscalls.c,v 1.39 2000/04/15 21:14:52 tsarna Exp $ */
+/*     $NetBSD: nfs_syscalls.c,v 1.40 2000/05/07 01:38:36 tsarna Exp $ */
 
 /*
  * Copyright (c) 1989, 1993
@@ -109,7 +109,7 @@
 
 #ifdef NFS
 static struct proc *nfs_asyncdaemon[NFS_MAXASYNCDAEMON];
-int nfs_niothreads = 0;
+int nfs_niothreads = -1; /* == "0, and has never been set" */
 #endif
 
 #ifdef NFSSERVER
@@ -1000,7 +1000,8 @@
                                start++;
                        }
        } else {
-               nfs_niothreads = have;
+               if (nfs_niothreads >= 0)
+                       nfs_niothreads = have;
        }
 }
 
diff -r bd10c6a98768 -r 15389c06d68f sys/nfs/nfs_vfsops.c
--- a/sys/nfs/nfs_vfsops.c      Sun May 07 01:38:15 2000 +0000
+++ b/sys/nfs/nfs_vfsops.c      Sun May 07 01:38:36 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_vfsops.c,v 1.89 2000/04/15 21:14:53 tsarna Exp $   */
+/*     $NetBSD: nfs_vfsops.c,v 1.90 2000/05/07 01:38:36 tsarna Exp $   */
 
 /*
  * Copyright (c) 1989, 1993, 1995
@@ -613,6 +613,16 @@
        struct vattr attrs;
        struct ucred *cr;
 
+       /* 
+        * If the number of nfs iothreads to use has never
+        * been set, create a reasonable number of them.
+        */
+
+       if (nfs_niothreads < 0) {
+               nfs_niothreads = 4;
+               nfs_getset_niothreads(TRUE);
+       }
+       
        if (mp->mnt_flag & MNT_UPDATE) {
                nmp = VFSTONFS(mp);
                /* update paths, file handles, etc, here        XXX */



Home | Main Index | Thread Index | Old Index