svn commit: r316619 - head/sbin/mount_nfs

Brooks Davis brooks at FreeBSD.org
Fri Apr 7 18:31:33 UTC 2017


Author: brooks
Date: Fri Apr  7 18:31:31 2017
New Revision: 316619
URL: https://svnweb.freebsd.org/changeset/base/316619

Log:
  Remove support for long gone oldnfs.
  
  The code was calling nmount with an fstype of everything in the program
  name after the last '_'. This was there to support mount_nfs being
  linked to mount_oldnfs. Support for the link was removed in 2015 with
  r281691.
  
  Reviewed by:	rmacklem
  Obtained from:	CheriBSD
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D10301

Modified:
  head/sbin/mount_nfs/mount_nfs.c

Modified: head/sbin/mount_nfs/mount_nfs.c
==============================================================================
--- head/sbin/mount_nfs/mount_nfs.c	Fri Apr  7 17:00:36 2017	(r316618)
+++ head/sbin/mount_nfs/mount_nfs.c	Fri Apr  7 18:31:31 2017	(r316619)
@@ -153,19 +153,13 @@ main(int argc, char *argv[])
 	char *mntname, *p, *spec, *tmp;
 	char mntpath[MAXPATHLEN], errmsg[255];
 	char hostname[MAXHOSTNAMELEN + 1], gssn[MAXHOSTNAMELEN + 50];
-	const char *fstype, *gssname;
+	const char *gssname;
 
 	iov = NULL;
 	iovlen = 0;
 	memset(errmsg, 0, sizeof(errmsg));
 	gssname = NULL;
 
-	fstype = strrchr(argv[0], '_');
-	if (fstype == NULL)
-		errx(EX_USAGE, "argv[0] must end in _fstype");
-
-	++fstype;
-
 	while ((c = getopt(argc, argv,
 	    "23a:bcdD:g:I:iLlNo:PR:r:sTt:w:x:U")) != -1)
 		switch (c) {
@@ -272,7 +266,6 @@ main(int argc, char *argv[])
 				} else if (strcmp(opt, "nfsv4") == 0) {
 					pass_flag_to_nmount=0;
 					mountmode = V4;
-					fstype = "nfs";
 					nfsproto = IPPROTO_TCP;
 					if (portspec == NULL)
 						portspec = "2049";
@@ -355,7 +348,6 @@ main(int argc, char *argv[])
 						break;
 					case 4:
 						mountmode = V4;
-						fstype = "nfs";
 						nfsproto = IPPROTO_TCP;
 						if (portspec == NULL)
 							portspec = "2049";
@@ -436,17 +428,11 @@ main(int argc, char *argv[])
 		/* The default is to keep retrying forever. */
 		retrycnt = 0;
 
-	/*
-	 * If the fstye is "oldnfs", run the old NFS client unless the
-	 * "nfsv4" option was specified.
-	 */
-	if (strcmp(fstype, "nfs") == 0) {
-		if (modfind("nfscl") < 0) {
-			/* Not present in kernel, try loading it */
-			if (kldload("nfscl") < 0 ||
-			    modfind("nfscl") < 0)
-				errx(1, "nfscl is not available");
-		}
+	if (modfind("nfscl") < 0) {
+		/* Not present in kernel, try loading it */
+		if (kldload("nfscl") < 0 ||
+		    modfind("nfscl") < 0)
+			errx(1, "nfscl is not available");
 	}
 
 	/*
@@ -470,8 +456,7 @@ main(int argc, char *argv[])
 	if (checkpath(mntname, mntpath) != 0)
 		err(1, "%s", mntpath);
 
-	build_iovec(&iov, &iovlen, "fstype", 
-	    __DECONST(void *, fstype), (size_t)-1);
+	build_iovec_argf(&iov, &iovlen, "fstype", "nfs");
 	build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1);
 	build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
 


More information about the svn-src-all mailing list