From owner-svn-src-head@FreeBSD.ORG Wed Apr 29 12:33:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CA265C0; Wed, 29 Apr 2015 12:33:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D86A195A; Wed, 29 Apr 2015 12:33:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3TCX1ux078173; Wed, 29 Apr 2015 12:33:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3TCX0S7078170; Wed, 29 Apr 2015 12:33:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201504291233.t3TCX0S7078170@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 29 Apr 2015 12:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282214 - head/usr.sbin/mountd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 12:33:01 -0000 Author: trasz Date: Wed Apr 29 12:33:00 2015 New Revision: 282214 URL: https://svnweb.freebsd.org/changeset/base/282214 Log: Remove oldnfs leftovers from mountd(8). Reviewed by: rmacklem@ Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/mountd/mountd.8 head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.8 ============================================================================== --- head/usr.sbin/mountd/mountd.8 Wed Apr 29 10:23:02 2015 (r282213) +++ head/usr.sbin/mountd/mountd.8 Wed Apr 29 12:33:00 2015 (r282214) @@ -38,7 +38,7 @@ mount requests .Sh SYNOPSIS .Nm -.Op Fl 2delnorS +.Op Fl 2delnrS .Op Fl h Ar bindip .Op Fl p Ar port .Op Ar exportsfile ... @@ -69,8 +69,7 @@ Output debugging information. will not detach from the controlling terminal and will print debugging messages to stderr. .It Fl e -The new NFS server that includes NFSv4 support is now the default, so this -option is now a no-op and should be considered deprecated. +Ignored; included for backward compatibility. .It Fl h Ar bindip Specify specific IP addresses to bind to for TCP and UDP requests. This option may be specified multiple times. @@ -98,9 +97,6 @@ This should only be specified if there a that require it. It will automatically clear the vfs.nfsrv.nfs_privport sysctl flag, which controls if the kernel will accept NFS requests from reserved ports only. -.It Fl o -This flag forces the system to run the old NFS server, which does not -have NFSv4 support in it. .It Fl p Ar port Force .Nm Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Wed Apr 29 10:23:02 2015 (r282213) +++ head/usr.sbin/mountd/mountd.c Wed Apr 29 12:33:00 2015 (r282214) @@ -253,7 +253,6 @@ static int have_v6 = 1; int v4root_phase = 0; char v4root_dirpath[PATH_MAX + 1]; -int run_v4server = 1; int has_publicfh = 0; struct pidfh *pfh = NULL; @@ -312,7 +311,7 @@ main(int argc, char **argv) else close(s); - while ((c = getopt(argc, argv, "2deh:lnop:rS")) != -1) + while ((c = getopt(argc, argv, "2deh:lnp:rS")) != -1) switch (c) { case '2': force_v2 = 1; @@ -332,9 +331,6 @@ main(int argc, char **argv) case 'l': dolog = 1; break; - case 'o': - run_v4server = 0; - break; case 'p': endptr = NULL; svcport = (in_port_t)strtoul(optarg, &endptr, 10); @@ -371,19 +367,9 @@ main(int argc, char **argv) usage(); }; - /* - * Unless the "-o" option was specified, try and run "nfsd". - * If "-o" was specified, try and run "nfsserver". - */ - if (run_v4server > 0) { - if (modfind("nfsd") < 0) { - /* Not present in kernel, try loading it */ - if (kldload("nfsd") < 0 || modfind("nfsd") < 0) - errx(1, "NFS server is not available"); - } - } else if (modfind("nfsserver") < 0) { + if (modfind("nfsd") < 0) { /* Not present in kernel, try loading it */ - if (kldload("nfsserver") < 0 || modfind("nfsserver") < 0) + if (kldload("nfsd") < 0 || modfind("nfsd") < 0) errx(1, "NFS server is not available"); } @@ -1697,8 +1683,7 @@ get_exportlist(void) */ bzero(&eargs, sizeof (eargs)); eargs.export.ex_flags = MNT_DELEXPORT; - if (run_v4server > 0 && - nfssvc(NFSSVC_V4ROOTEXPORT, (caddr_t)&eargs) < 0 && + if (nfssvc(NFSSVC_V4ROOTEXPORT, (caddr_t)&eargs) < 0 && errno != ENOENT) syslog(LOG_ERR, "Can't delete exports for V4:"); @@ -1803,7 +1788,7 @@ get_exportlist(void) /* * If there was no public fh, clear any previous one set. */ - if (run_v4server > 0 && has_publicfh == 0) + if (has_publicfh == 0) (void) nfssvc(NFSSVC_NOPUBLICFH, NULL); /* Resume the nfsd. If they weren't suspended, this is harmless. */ @@ -2400,7 +2385,7 @@ do_mount(struct exportlist *ep, struct g { struct statfs fsb1; struct addrinfo *ai; - struct export_args ea, *eap; + struct export_args *eap; char errmsg[255]; char *cp; int done; @@ -2410,10 +2395,7 @@ do_mount(struct exportlist *ep, struct g int ret; struct nfsex_args nfsea; - if (run_v4server > 0) - eap = &nfsea.export; - else - eap = &ea; + eap = &nfsea.export; cp = NULL; savedc = '\0'; @@ -2493,8 +2475,7 @@ do_mount(struct exportlist *ep, struct g */ if (v4root_phase == 2) { nfsea.fspec = v4root_dirpath; - if (run_v4server > 0 && - nfssvc(NFSSVC_V4ROOTEXPORT, (caddr_t)&nfsea) < 0) { + if (nfssvc(NFSSVC_V4ROOTEXPORT, (caddr_t)&nfsea) < 0) { syslog(LOG_ERR, "Exporting V4: failed"); return (2); } @@ -2583,7 +2564,7 @@ do_mount(struct exportlist *ep, struct g * If this is the public directory, get the file handle * and load it into the kernel via the nfssvc() syscall. */ - if (run_v4server > 0 && (exflags & MNT_EXPUBLIC) != 0) { + if ((exflags & MNT_EXPUBLIC) != 0) { fhandle_t fh; char *public_name;