From owner-svn-src-all@FreeBSD.ORG Thu Feb 14 02:00:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D0AB9F1B; Thu, 14 Feb 2013 02:00:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AB981DB8; Thu, 14 Feb 2013 02:00:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1E20fD6010869; Thu, 14 Feb 2013 02:00:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1E20fSc010868; Thu, 14 Feb 2013 02:00:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302140200.r1E20fSc010868@svn.freebsd.org> From: Xin LI Date: Thu, 14 Feb 2013 02:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246781 - head/usr.sbin/nfsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Feb 2013 02:00:41 -0000 Author: delphij Date: Thu Feb 14 02:00:41 2013 New Revision: 246781 URL: http://svnweb.freebsd.org/changeset/base/246781 Log: 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 Modified: head/usr.sbin/nfsd/nfsd.c Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Thu Feb 14 01:25:14 2013 (r246780) +++ head/usr.sbin/nfsd/nfsd.c Thu Feb 14 02:00:41 2013 (r246781) @@ -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) {