Delete some cruft from the experimental NFS server that was

only used by the OpenBSD port for its pseudo-fs.

MFC after:	2 weeks
This commit is contained in:
Rick Macklem 2011-01-02 21:34:01 +00:00
parent 629fa50e68
commit c9aad40f5f
3 changed files with 9 additions and 42 deletions

View File

@ -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 ucred *cred, struct thread *p)
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);
/*

View File

@ -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 *nd, __unused int isdgram,
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, __unused int isdgram,
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 *nd, __unused int isdgram,
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_descript *nd,
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_descript *nd, __unused int isdgram,
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);
}

View File

@ -50,8 +50,6 @@ extern struct nfsclienthashhead nfsclienthash[NFSCLIENTHASHSIZE];
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 *nd, int isdgram,
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 *nd, int isdgram,
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 *nd, int isdgram,
vpnes.nes_vfslocked =
nfsvno_lockvfs(mp);
}
}
}
if (!nd->nd_repstat) {
vrele(vp);