Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Jan 2011 21:34:01 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216894 - head/sys/fs/nfsserver
Message-ID:  <201101022134.p02LY1Sm059086@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sun Jan  2 21:34:01 2011
New Revision: 216894
URL: http://svn.freebsd.org/changeset/base/216894

Log:
  Delete some cruft from the experimental NFS server that was
  only used by the OpenBSD port for its pseudo-fs.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdserv.c
  head/sys/fs/nfsserver/nfs_nfsdsocket.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Sun Jan  2 19:58:39 2011	(r216893)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Sun Jan  2 21:34:01 2011	(r216894)
@@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
 #include <nlm/nlm.h>
 
 extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1;
-extern int nfsv4root_set;
 extern int nfsrv_useacl;
 extern int newnfs_numnfsd;
 extern struct mount nfsv4root_mnt;
@@ -2677,10 +2676,9 @@ nfsrv_v4rootexport(void *argp, struct uc
 	fhandle_t fh;
 
 	error = vfs_export(&nfsv4root_mnt, &nfsexargp->export);
-	if ((nfsexargp->export.ex_flags & MNT_DELEXPORT)) {
+	if ((nfsexargp->export.ex_flags & MNT_DELEXPORT) != 0)
 		nfs_rootfhset = 0;
-		nfsv4root_set = 0;
-	} else if (error == 0) {
+	else if (error == 0) {
 		if (nfsexargp->fspec == NULL)
 			return (EPERM);
 		/*

Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdserv.c	Sun Jan  2 19:58:39 2011	(r216893)
+++ head/sys/fs/nfsserver/nfs_nfsdserv.c	Sun Jan  2 21:34:01 2011	(r216894)
@@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$");
 extern u_int32_t newnfs_false, newnfs_true;
 extern enum vtype nv34tov_type[8];
 extern struct timeval nfsboottime;
-extern int nfs_rootfhset, nfsv4root_set;
+extern int nfs_rootfhset;
 #endif	/* !APPLEKEXT */
 
 /*
@@ -2874,8 +2874,7 @@ nfsrvd_delegpurge(struct nfsrv_descript 
 	int error = 0;
 	nfsquad_t clientid;
 
-	if ((!nfs_rootfhset && !nfsv4root_set) ||
-	    nfsd_checkrootexp(nd)) {
+	if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) {
 		nd->nd_repstat = NFSERR_WRONGSEC;
 		return (0);
 	}
@@ -3073,8 +3072,7 @@ nfsrvd_renew(struct nfsrv_descript *nd, 
 	int error = 0;
 	nfsquad_t clientid;
 
-	if ((!nfs_rootfhset && !nfsv4root_set) ||
-	    nfsd_checkrootexp(nd)) {
+	if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) {
 		nd->nd_repstat = NFSERR_WRONGSEC;
 		return (0);
 	}
@@ -3212,8 +3210,7 @@ nfsrvd_setclientid(struct nfsrv_descript
 	u_char *verf, *ucp, *ucp2, addrbuf[24];
 	nfsquad_t clientid, confirm;
 
-	if ((!nfs_rootfhset && !nfsv4root_set) ||
-	    nfsd_checkrootexp(nd)) {
+	if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) {
 		nd->nd_repstat = NFSERR_WRONGSEC;
 		return (0);
 	}
@@ -3321,8 +3318,7 @@ nfsrvd_setclientidcfrm(struct nfsrv_desc
 	int error = 0;
 	nfsquad_t clientid, confirm;
 
-	if ((!nfs_rootfhset && !nfsv4root_set) ||
-	    nfsd_checkrootexp(nd)) {
+	if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) {
 		nd->nd_repstat = NFSERR_WRONGSEC;
 		return (0);
 	}
@@ -3409,8 +3405,7 @@ nfsrvd_releaselckown(struct nfsrv_descri
 	int error = 0, len;
 	nfsquad_t clientid;
 
-	if ((!nfs_rootfhset && !nfsv4root_set) ||
-	    nfsd_checkrootexp(nd)) {
+	if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) {
 		nd->nd_repstat = NFSERR_WRONGSEC;
 		return (0);
 	}

Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdsocket.c	Sun Jan  2 19:58:39 2011	(r216893)
+++ head/sys/fs/nfsserver/nfs_nfsdsocket.c	Sun Jan  2 21:34:01 2011	(r216894)
@@ -50,8 +50,6 @@ extern struct nfsclienthashhead nfsclien
 extern int nfsrc_floodlevel, nfsrc_tcpsavedreplies;
 NFSV4ROOTLOCKMUTEX;
 NFSSTATESPINLOCK;
-vnode_t nfsv4root_vp = NULL;
-int nfsv4root_set = 0;
 
 int (*nfsrv3_procs0[NFS_V3NPROCS])(struct nfsrv_descript *,
     int, vnode_t , NFSPROC_T *, struct nfsexstuff *) = {
@@ -748,20 +746,8 @@ nfsrvd_compound(struct nfsrv_descript *n
 					NFSVOPUNLOCK(vp, 0, p);
 					vpnes = nes;
 				}
-			} else if (nfsv4root_vp && nfsv4root_set) {
-				if (vp) {
-					if (vpnes.nes_vfslocked)
-						nfsvno_unlockvfs(mp);
-					vrele(vp);
-				}
-				vp = nfsv4root_vp;
-				VREF(vp);
-				NFSVNO_SETEXRDONLY(&vpnes);
-				vpnes.nes_vfslocked = 0;
-				mp = vnode_mount(vp);
-			} else {
+			} else
 				nd->nd_repstat = NFSERR_NOFILEHANDLE;
-			}
 			break;
 		case NFSV4OP_SAVEFH:
 			if (vp && NFSVNO_EXPORTED(&vpnes)) {
@@ -859,17 +845,6 @@ nfsrvd_compound(struct nfsrv_descript *n
 				vfs_statfs(vnode_mount(nvp))->f_fsid.val[0] ||
 				vfs_statfs(mp)->f_fsid.val[1] !=
 				vfs_statfs(vnode_mount(nvp))->f_fsid.val[1]) {
-				if (vfs_statfs(vnode_mount(nvp))->f_fsid.val[0] ==
-				    NFSV4ROOT_FSID0 &&
-				    vfs_statfs(vnode_mount(nvp))->f_fsid.val[1] ==
-				    NFSV4ROOT_FSID1) {
-				    if (vpnes.nes_vfslocked) {
-					nfsvno_unlockvfs(mp);
-					vpnes.nes_vfslocked = 0;
-				    }
-				    NFSVNO_SETEXRDONLY(&vpnes);
-				    mp = vnode_mount(nvp);
-				} else {
 				    nd->nd_repstat = nfsvno_checkexp(vnode_mount(nvp),
 					nd->nd_nam, &nes, &credanon);
 				    if (!nd->nd_repstat)
@@ -885,7 +860,6 @@ nfsrvd_compound(struct nfsrv_descript *n
 					vpnes.nes_vfslocked =
 					    nfsvno_lockvfs(mp);
 				    }
-				}
 			    }
 			    if (!nd->nd_repstat) {
 				    vrele(vp);



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