Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Apr 2015 12:33:00 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r282214 - head/usr.sbin/mountd
Message-ID:  <201504291233.t3TCX0S7078170@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504291233.t3TCX0S7078170>