summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2013-02-14 02:00:41 +0000
committerdelphij <delphij@FreeBSD.org>2013-02-14 02:00:41 +0000
commitf061b4d30288fe6652257e99f3e156532f5ed792 (patch)
treec426ed23ebbd8de76f09c826d0f3bad00f480093 /usr.sbin
parent236389d4e1b113bad02d1341c69f20ff70b57350 (diff)
downloadFreeBSD-src-f061b4d30288fe6652257e99f3e156532f5ed792.zip
FreeBSD-src-f061b4d30288fe6652257e99f3e156532f5ed792.tar.gz
Simplify r243637 and make sure that nfsdargs.{min,max}threads are always set
to meaningful value: - When nfsdcnt is set, it dictates all values; - Otherwise, nfsdargs.minthreads is set to user specified value, or the automatically detected value if there is no one specified; nfsdargs.maxthreads is set to the user specified value, or the value of nfsdargs.minthreads if there is no one specified; when it is smaller than nfsdargs.minthreads, the latter's value is always used. MFC after: 2 weeks
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/nfsd/nfsd.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c
index 3fa267c..b114ba6 100644
--- a/usr.sbin/nfsd/nfsd.c
+++ b/usr.sbin/nfsd/nfsd.c
@@ -1014,26 +1014,13 @@ start_server(int master)
}
nfsdargs.principal = principal;
- if (minthreads_set) {
- nfsdargs.minthreads = minthreads;
- if (!maxthreads_set)
- nfsdargs.maxthreads = minthreads;
- }
- if (maxthreads_set) {
- nfsdargs.maxthreads = maxthreads;
- if (!minthreads_set)
- nfsdargs.minthreads = maxthreads;
- }
- if (nfsdcnt_set) {
- nfsdargs.minthreads = nfsdcnt;
- nfsdargs.maxthreads = nfsdcnt;
- }
- if (!minthreads_set && !maxthreads_set && !nfsdcnt_set) {
- int tuned_nfsdcnt;
-
- tuned_nfsdcnt = get_tuned_nfsdcount();
- nfsdargs.minthreads = tuned_nfsdcnt;
- nfsdargs.maxthreads = tuned_nfsdcnt;
+ if (nfsdcnt_set)
+ nfsdargs.minthreads = nfsdargs.maxthreads = nfsdcnt;
+ else {
+ nfsdargs.minthreads = minthreads_set ? minthreads : get_tuned_nfsdcount();
+ nfsdargs.maxthreads = maxthreads_set ? maxthreads : nfsdargs.minthreads;
+ if (nfsdargs.maxthreads < nfsdargs.minthreads)
+ nfsdargs.maxthreads = nfsdargs.minthreads;
}
error = nfssvc(nfssvc_nfsd, &nfsdargs);
if (error < 0 && errno == EAUTH) {
OpenPOWER on IntegriCloud