Changeset View
Changeset View
Standalone View
Standalone View
head/sys/fs/nfsserver/nfs_nfsdport.c
Show First 20 Lines • Show All 341 Lines • ▼ Show 20 Lines | nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp, | ||||
struct vnode *dp, int islocked, struct nfsexstuff *exp, struct thread *p, | struct vnode *dp, int islocked, struct nfsexstuff *exp, struct thread *p, | ||||
struct vnode **retdirp) | struct vnode **retdirp) | ||||
{ | { | ||||
struct componentname *cnp = &ndp->ni_cnd; | struct componentname *cnp = &ndp->ni_cnd; | ||||
int i; | int i; | ||||
struct iovec aiov; | struct iovec aiov; | ||||
struct uio auio; | struct uio auio; | ||||
int lockleaf = (cnp->cn_flags & LOCKLEAF) != 0, linklen; | int lockleaf = (cnp->cn_flags & LOCKLEAF) != 0, linklen; | ||||
int error = 0, crossmnt; | int error = 0; | ||||
char *cp; | char *cp; | ||||
*retdirp = NULL; | *retdirp = NULL; | ||||
cnp->cn_nameptr = cnp->cn_pnbuf; | cnp->cn_nameptr = cnp->cn_pnbuf; | ||||
ndp->ni_lcf = 0; | ndp->ni_lcf = 0; | ||||
/* | /* | ||||
* Extract and set starting directory. | * Extract and set starting directory. | ||||
*/ | */ | ||||
if (dp->v_type != VDIR) { | if (dp->v_type != VDIR) { | ||||
if (islocked) | if (islocked) | ||||
vput(dp); | vput(dp); | ||||
else | else | ||||
vrele(dp); | vrele(dp); | ||||
nfsvno_relpathbuf(ndp); | nfsvno_relpathbuf(ndp); | ||||
error = ENOTDIR; | error = ENOTDIR; | ||||
goto out1; | goto out1; | ||||
} | } | ||||
if (islocked) | if (islocked) | ||||
NFSVOPUNLOCK(dp, 0); | NFSVOPUNLOCK(dp, 0); | ||||
VREF(dp); | VREF(dp); | ||||
*retdirp = dp; | *retdirp = dp; | ||||
if (NFSVNO_EXRDONLY(exp)) | if (NFSVNO_EXRDONLY(exp)) | ||||
cnp->cn_flags |= RDONLY; | cnp->cn_flags |= RDONLY; | ||||
ndp->ni_segflg = UIO_SYSSPACE; | ndp->ni_segflg = UIO_SYSSPACE; | ||||
crossmnt = 1; | |||||
if (nd->nd_flag & ND_PUBLOOKUP) { | if (nd->nd_flag & ND_PUBLOOKUP) { | ||||
ndp->ni_loopcnt = 0; | ndp->ni_loopcnt = 0; | ||||
if (cnp->cn_pnbuf[0] == '/') { | if (cnp->cn_pnbuf[0] == '/') { | ||||
vrele(dp); | vrele(dp); | ||||
/* | /* | ||||
* Check for degenerate pathnames here, since lookup() | * Check for degenerate pathnames here, since lookup() | ||||
* panics on them. | * panics on them. | ||||
Show All 11 Lines | nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp, | ||||
} else if ((nfsrv_enable_crossmntpt == 0 && NFSVNO_EXPORTED(exp)) || | } else if ((nfsrv_enable_crossmntpt == 0 && NFSVNO_EXPORTED(exp)) || | ||||
(nd->nd_flag & ND_NFSV4) == 0) { | (nd->nd_flag & ND_NFSV4) == 0) { | ||||
/* | /* | ||||
* Only cross mount points for NFSv4 when doing a | * Only cross mount points for NFSv4 when doing a | ||||
* mount while traversing the file system above | * mount while traversing the file system above | ||||
* the mount point, unless nfsrv_enable_crossmntpt is set. | * the mount point, unless nfsrv_enable_crossmntpt is set. | ||||
*/ | */ | ||||
cnp->cn_flags |= NOCROSSMOUNT; | cnp->cn_flags |= NOCROSSMOUNT; | ||||
crossmnt = 0; | |||||
} | } | ||||
/* | /* | ||||
* Initialize for scan, set ni_startdir and bump ref on dp again | * Initialize for scan, set ni_startdir and bump ref on dp again | ||||
* because lookup() will dereference ni_startdir. | * because lookup() will dereference ni_startdir. | ||||
*/ | */ | ||||
cnp->cn_thread = p; | cnp->cn_thread = p; | ||||
▲ Show 20 Lines • Show All 3,032 Lines • Show Last 20 Lines |