Add an argument to nfsvno_getattr() in the experimental
NFS server, so that it can avoid calling VOP_ISLOCKED() when the vnode is known to be locked. This will allow LK_SHARED to be used for these cases, which happen to be all the cases that can use LK_SHARED. This does not fix any bug, but it reduces the number of calls to VOP_ISLOCKED() and prepares the code so that it can be switched to using LK_SHARED in a future patch. Reviewed by: kib MFC after: 2 weeks
This commit is contained in:
parent
a852f40b7a
commit
0cf42b622b
@ -510,7 +510,7 @@ void ncl_invalcaches(vnode_t);
|
||||
|
||||
/* nfs_nfsdport.c */
|
||||
int nfsvno_getattr(vnode_t, struct nfsvattr *, struct ucred *,
|
||||
NFSPROC_T *);
|
||||
NFSPROC_T *, int);
|
||||
int nfsvno_setattr(vnode_t, struct nfsvattr *, struct ucred *,
|
||||
NFSPROC_T *, struct nfsexstuff *);
|
||||
int nfsvno_getfh(vnode_t, fhandle_t *, NFSPROC_T *);
|
||||
|
@ -100,18 +100,24 @@ static struct nfsheur {
|
||||
*/
|
||||
int
|
||||
nfsvno_getattr(struct vnode *vp, struct nfsvattr *nvap, struct ucred *cred,
|
||||
struct thread *p)
|
||||
struct thread *p, int vpislocked)
|
||||
{
|
||||
int error, lockedit = 0;
|
||||
|
||||
/* Since FreeBSD insists the vnode be locked... */
|
||||
if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) {
|
||||
lockedit = 1;
|
||||
NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p);
|
||||
if (vpislocked == 0) {
|
||||
/*
|
||||
* When vpislocked == 0, the vnode is either exclusively
|
||||
* locked by this thread or not locked by this thread.
|
||||
* As such, shared lock it, if not exclusively locked.
|
||||
*/
|
||||
if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) {
|
||||
lockedit = 1;
|
||||
vn_lock(vp, LK_SHARED | LK_RETRY);
|
||||
}
|
||||
}
|
||||
error = VOP_GETATTR(vp, &nvap->na_vattr, cred);
|
||||
if (lockedit)
|
||||
NFSVOPUNLOCK(vp, 0, p);
|
||||
if (lockedit != 0)
|
||||
VOP_UNLOCK(vp, 0);
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -1375,7 +1381,7 @@ nfsvno_updfilerev(struct vnode *vp, struct nfsvattr *nvap,
|
||||
VATTR_NULL(&va);
|
||||
getnanotime(&va.va_mtime);
|
||||
(void) VOP_SETATTR(vp, &va, cred);
|
||||
(void) nfsvno_getattr(vp, nvap, cred, p);
|
||||
(void) nfsvno_getattr(vp, nvap, cred, p, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1456,7 +1462,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isdgram,
|
||||
fullsiz = siz;
|
||||
if (nd->nd_flag & ND_NFSV3) {
|
||||
nd->nd_repstat = getret = nfsvno_getattr(vp, &at, nd->nd_cred,
|
||||
p);
|
||||
p, 1);
|
||||
#if 0
|
||||
/*
|
||||
* va_filerev is not sufficient as a cookie verifier,
|
||||
@ -1512,7 +1518,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isdgram,
|
||||
if (!cookies && !nd->nd_repstat)
|
||||
nd->nd_repstat = NFSERR_PERM;
|
||||
if (nd->nd_flag & ND_NFSV3) {
|
||||
getret = nfsvno_getattr(vp, &at, nd->nd_cred, p);
|
||||
getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1);
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = getret;
|
||||
}
|
||||
@ -1723,7 +1729,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdgram,
|
||||
NFSZERO_ATTRBIT(&attrbits);
|
||||
}
|
||||
fullsiz = siz;
|
||||
nd->nd_repstat = getret = nfsvno_getattr(vp, &at, nd->nd_cred, p);
|
||||
nd->nd_repstat = getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1);
|
||||
if (!nd->nd_repstat) {
|
||||
if (off && verf != at.na_filerev) {
|
||||
/*
|
||||
@ -1782,7 +1788,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdgram,
|
||||
if (io.uio_resid)
|
||||
siz -= io.uio_resid;
|
||||
|
||||
getret = nfsvno_getattr(vp, &at, nd->nd_cred, p);
|
||||
getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1);
|
||||
|
||||
if (!cookies && !nd->nd_repstat)
|
||||
nd->nd_repstat = NFSERR_PERM;
|
||||
@ -1958,7 +1964,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdgram,
|
||||
r = nfsvno_getfh(nvp, &nfh, p);
|
||||
if (!r)
|
||||
r = nfsvno_getattr(nvp, nvap,
|
||||
nd->nd_cred, p);
|
||||
nd->nd_cred, p, 1);
|
||||
}
|
||||
} else {
|
||||
nvp = NULL;
|
||||
|
@ -144,7 +144,7 @@ nfsrvd_access(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
}
|
||||
nfsmode &= supported;
|
||||
if (nd->nd_flag & ND_NFSV3) {
|
||||
getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p);
|
||||
getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
|
||||
nfsrv_postopattr(nd, getret, &nva);
|
||||
}
|
||||
vput(vp);
|
||||
@ -199,7 +199,7 @@ nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram,
|
||||
NFSACCCHK_VPISLOCKED, NULL);
|
||||
}
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p);
|
||||
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
|
||||
if (!nd->nd_repstat) {
|
||||
if (nd->nd_flag & ND_NFSV4) {
|
||||
if (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_FILEHANDLE))
|
||||
@ -255,7 +255,7 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
error = nfsrv_sattr(nd, &nva, &attrbits, aclp, p);
|
||||
if (error)
|
||||
goto nfsmout;
|
||||
preat_ret = nfsvno_getattr(vp, &nva2, nd->nd_cred, p);
|
||||
preat_ret = nfsvno_getattr(vp, &nva2, nd->nd_cred, p, 1);
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = preat_ret;
|
||||
if (nd->nd_flag & ND_NFSV3) {
|
||||
@ -375,7 +375,7 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
exp);
|
||||
}
|
||||
if (nd->nd_flag & (ND_NFSV2 | ND_NFSV3)) {
|
||||
postat_ret = nfsvno_getattr(vp, &nva, nd->nd_cred, p);
|
||||
postat_ret = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = postat_ret;
|
||||
}
|
||||
@ -456,7 +456,7 @@ nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
if (dirp) {
|
||||
if (nd->nd_flag & ND_NFSV3)
|
||||
dattr_ret = nfsvno_getattr(dirp, &dattr,
|
||||
nd->nd_cred, p);
|
||||
nd->nd_cred, p, 0);
|
||||
vrele(dirp);
|
||||
}
|
||||
if (nd->nd_flag & ND_NFSV3)
|
||||
@ -469,7 +469,7 @@ nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
vp = named.ni_vp;
|
||||
nd->nd_repstat = nfsvno_getfh(vp, fhp, p);
|
||||
if (!(nd->nd_flag & ND_NFSV4) && !nd->nd_repstat)
|
||||
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p);
|
||||
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
|
||||
if (vpp) {
|
||||
NFSVOPUNLOCK(vp, 0, p);
|
||||
*vpp = vp;
|
||||
@ -479,7 +479,7 @@ nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
if (dirp) {
|
||||
if (nd->nd_flag & ND_NFSV3)
|
||||
dattr_ret = nfsvno_getattr(dirp, &dattr, nd->nd_cred,
|
||||
p);
|
||||
p, 0);
|
||||
vrele(dirp);
|
||||
}
|
||||
if (nd->nd_repstat) {
|
||||
@ -524,7 +524,7 @@ nfsrvd_readlink(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
nd->nd_repstat = nfsvno_readlink(vp, nd->nd_cred, p,
|
||||
&mp, &mpend, &len);
|
||||
if (nd->nd_flag & ND_NFSV3)
|
||||
getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p);
|
||||
getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
|
||||
vput(vp);
|
||||
if (nd->nd_flag & ND_NFSV3)
|
||||
nfsrv_postopattr(nd, getret, &nva);
|
||||
@ -612,7 +612,7 @@ nfsrvd_read(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
nd->nd_repstat = (vnode_vtype(vp) == VDIR) ? EISDIR :
|
||||
EINVAL;
|
||||
}
|
||||
getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p);
|
||||
getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = getret;
|
||||
if (!nd->nd_repstat &&
|
||||
@ -650,7 +650,7 @@ nfsrvd_read(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
nd->nd_repstat = nfsvno_read(vp, off, cnt, nd->nd_cred, p,
|
||||
&m3, &m2);
|
||||
if (!(nd->nd_flag & ND_NFSV4)) {
|
||||
getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p);
|
||||
getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = getret;
|
||||
}
|
||||
@ -788,7 +788,7 @@ nfsrvd_write(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
nd->nd_repstat = (vnode_vtype(vp) == VDIR) ? EISDIR :
|
||||
EINVAL;
|
||||
}
|
||||
forat_ret = nfsvno_getattr(vp, &forat, nd->nd_cred, p);
|
||||
forat_ret = nfsvno_getattr(vp, &forat, nd->nd_cred, p, 1);
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = forat_ret;
|
||||
if (!nd->nd_repstat &&
|
||||
@ -823,7 +823,7 @@ nfsrvd_write(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
if (nd->nd_flag & ND_NFSV4)
|
||||
aftat_ret = 0;
|
||||
else
|
||||
aftat_ret = nfsvno_getattr(vp, &nva, nd->nd_cred, p);
|
||||
aftat_ret = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
|
||||
vput(vp);
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = aftat_ret;
|
||||
@ -939,7 +939,7 @@ nfsrvd_create(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
nfsvno_relpathbuf(&named);
|
||||
if (nd->nd_flag & ND_NFSV3) {
|
||||
dirfor_ret = nfsvno_getattr(dp, &dirfor, nd->nd_cred,
|
||||
p);
|
||||
p, 1);
|
||||
nfsrv_wcc(nd, dirfor_ret, &dirfor, diraft_ret,
|
||||
&diraft);
|
||||
}
|
||||
@ -954,7 +954,7 @@ nfsrvd_create(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
dirp = NULL;
|
||||
} else {
|
||||
dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred,
|
||||
p);
|
||||
p, 0);
|
||||
}
|
||||
}
|
||||
if (nd->nd_repstat) {
|
||||
@ -993,7 +993,7 @@ nfsrvd_create(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
nd->nd_repstat = nfsvno_getfh(vp, &fh, p);
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred,
|
||||
p);
|
||||
p, 1);
|
||||
vput(vp);
|
||||
if (!nd->nd_repstat) {
|
||||
tverf[0] = nva.na_atime.tv_sec;
|
||||
@ -1009,7 +1009,7 @@ nfsrvd_create(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
if (exclusive_flag && !nd->nd_repstat && (cverf[0] != tverf[0]
|
||||
|| cverf[1] != tverf[1]))
|
||||
nd->nd_repstat = EEXIST;
|
||||
diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p);
|
||||
diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p, 0);
|
||||
vrele(dirp);
|
||||
if (!nd->nd_repstat) {
|
||||
(void) nfsm_fhtom(nd, (u_int8_t *)&fh, 0, 1);
|
||||
@ -1136,7 +1136,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
}
|
||||
}
|
||||
|
||||
dirfor_ret = nfsvno_getattr(dp, &dirfor, nd->nd_cred, p);
|
||||
dirfor_ret = nfsvno_getattr(dp, &dirfor, nd->nd_cred, p, 0);
|
||||
if (!nd->nd_repstat && (nd->nd_flag & ND_NFSV4)) {
|
||||
if (!dirfor_ret && NFSVNO_ISSETGID(&nva) &&
|
||||
dirfor.na_gid == nva.na_gid)
|
||||
@ -1175,7 +1175,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
if (dirp) {
|
||||
if (nd->nd_flag & ND_NFSV3)
|
||||
dirfor_ret = nfsvno_getattr(dirp, &dirfor,
|
||||
nd->nd_cred, p);
|
||||
nd->nd_cred, p, 0);
|
||||
vrele(dirp);
|
||||
}
|
||||
#ifdef NFS4_ACL_EXTATTR_NAME
|
||||
@ -1187,7 +1187,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
return (0);
|
||||
}
|
||||
if (dirp)
|
||||
dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, p);
|
||||
dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, p, 0);
|
||||
|
||||
if ((nd->nd_flag & ND_NFSV4) && (vtyp == VDIR || vtyp == VLNK)) {
|
||||
if (vtyp == VDIR) {
|
||||
@ -1217,7 +1217,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
nd->nd_repstat = nfsvno_getfh(vp, fhp, p);
|
||||
if ((nd->nd_flag & ND_NFSV3) && !nd->nd_repstat)
|
||||
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred,
|
||||
p);
|
||||
p, 1);
|
||||
if (vpp) {
|
||||
NFSVOPUNLOCK(vp, 0, p);
|
||||
*vpp = vp;
|
||||
@ -1226,7 +1226,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
}
|
||||
}
|
||||
|
||||
diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p);
|
||||
diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p, 0);
|
||||
vrele(dirp);
|
||||
if (!nd->nd_repstat) {
|
||||
if (nd->nd_flag & ND_NFSV3) {
|
||||
@ -1296,7 +1296,7 @@ nfsrvd_remove(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
if (dirp) {
|
||||
if (!(nd->nd_flag & ND_NFSV2)) {
|
||||
dirfor_ret = nfsvno_getattr(dirp, &dirfor,
|
||||
nd->nd_cred, p);
|
||||
nd->nd_cred, p, 0);
|
||||
} else {
|
||||
vrele(dirp);
|
||||
dirp = NULL;
|
||||
@ -1321,7 +1321,7 @@ nfsrvd_remove(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
if (!(nd->nd_flag & ND_NFSV2)) {
|
||||
if (dirp) {
|
||||
diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred,
|
||||
p);
|
||||
p, 0);
|
||||
vrele(dirp);
|
||||
}
|
||||
if (nd->nd_flag & ND_NFSV3) {
|
||||
@ -1364,7 +1364,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram,
|
||||
return (0);
|
||||
}
|
||||
if (!(nd->nd_flag & ND_NFSV2))
|
||||
fdirfor_ret = nfsvno_getattr(dp, &fdirfor, nd->nd_cred, p);
|
||||
fdirfor_ret = nfsvno_getattr(dp, &fdirfor, nd->nd_cred, p, 1);
|
||||
tond.ni_cnd.cn_nameiop = 0;
|
||||
tond.ni_startdir = NULL;
|
||||
NFSNAMEICNDSET(&fromnd.ni_cnd, nd->nd_cred, DELETE, WANTPARENT | SAVESTART);
|
||||
@ -1380,7 +1380,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram,
|
||||
if (nd->nd_flag & ND_NFSV4) {
|
||||
tdp = todp;
|
||||
tnes = *toexp;
|
||||
tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p);
|
||||
tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 0);
|
||||
} else {
|
||||
error = nfsrv_mtofh(nd, &tfh);
|
||||
if (error) {
|
||||
@ -1395,7 +1395,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram,
|
||||
nfsd_fhtovp(nd, &tfh, &tdp, &tnes, &mp, 0, p);
|
||||
if (tdp) {
|
||||
tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred,
|
||||
p);
|
||||
p, 1);
|
||||
NFSVOPUNLOCK(tdp, 0, p);
|
||||
}
|
||||
}
|
||||
@ -1463,9 +1463,11 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram,
|
||||
nd->nd_repstat = nfsvno_rename(&fromnd, &tond, nd->nd_repstat,
|
||||
nd->nd_flag, nd->nd_cred, p);
|
||||
if (fdirp)
|
||||
fdiraft_ret = nfsvno_getattr(fdirp, &fdiraft, nd->nd_cred, p);
|
||||
fdiraft_ret = nfsvno_getattr(fdirp, &fdiraft, nd->nd_cred, p,
|
||||
0);
|
||||
if (tdirp)
|
||||
tdiraft_ret = nfsvno_getattr(tdirp, &tdiraft, nd->nd_cred, p);
|
||||
tdiraft_ret = nfsvno_getattr(tdirp, &tdiraft, nd->nd_cred, p,
|
||||
0);
|
||||
if (tnes.nes_vfslocked && !exp->nes_vfslocked &&
|
||||
!(nd->nd_flag & ND_NFSV4))
|
||||
nfsvno_unlockvfs(mp);
|
||||
@ -1580,15 +1582,15 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram,
|
||||
dirp = NULL;
|
||||
} else {
|
||||
dirfor_ret = nfsvno_getattr(dirp, &dirfor,
|
||||
nd->nd_cred, p);
|
||||
nd->nd_cred, p, 0);
|
||||
}
|
||||
}
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = nfsvno_link(&named, vp, nd->nd_cred, p, exp);
|
||||
if (nd->nd_flag & ND_NFSV3)
|
||||
getret = nfsvno_getattr(vp, &at, nd->nd_cred, p);
|
||||
getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 0);
|
||||
if (dirp) {
|
||||
diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p);
|
||||
diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p, 0);
|
||||
vrele(dirp);
|
||||
}
|
||||
if (tnes.nes_vfslocked && !exp->nes_vfslocked &&
|
||||
@ -1659,12 +1661,12 @@ nfsrvd_symlink(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
if (!nd->nd_repstat) {
|
||||
if (dirp != NULL)
|
||||
dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred,
|
||||
p);
|
||||
p, 0);
|
||||
nfsrvd_symlinksub(nd, &named, &nva, fhp, vpp, dirp,
|
||||
&dirfor, &diraft, &diraft_ret, NULL, NULL, p, exp,
|
||||
pathcp, pathlen);
|
||||
} else if (dirp != NULL) {
|
||||
dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, p);
|
||||
dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, p, 0);
|
||||
vrele(dirp);
|
||||
}
|
||||
if (pathcp)
|
||||
@ -1701,7 +1703,7 @@ nfsrvd_symlinksub(struct nfsrv_descript *nd, struct nameidata *ndp,
|
||||
nd->nd_repstat = nfsvno_getfh(ndp->ni_vp, fhp, p);
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = nfsvno_getattr(ndp->ni_vp,
|
||||
nvap, nd->nd_cred, p);
|
||||
nvap, nd->nd_cred, p, 1);
|
||||
}
|
||||
if (vpp) {
|
||||
NFSVOPUNLOCK(ndp->ni_vp, 0, p);
|
||||
@ -1711,7 +1713,7 @@ nfsrvd_symlinksub(struct nfsrv_descript *nd, struct nameidata *ndp,
|
||||
}
|
||||
}
|
||||
if (dirp) {
|
||||
*diraft_retp = nfsvno_getattr(dirp, diraftp, nd->nd_cred, p);
|
||||
*diraft_retp = nfsvno_getattr(dirp, diraftp, nd->nd_cred, p, 0);
|
||||
vrele(dirp);
|
||||
}
|
||||
if ((nd->nd_flag & ND_NFSV4) && !nd->nd_repstat) {
|
||||
@ -1780,7 +1782,7 @@ nfsrvd_mkdir(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
if (nd->nd_repstat) {
|
||||
if (dirp != NULL) {
|
||||
dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred,
|
||||
p);
|
||||
p, 0);
|
||||
vrele(dirp);
|
||||
}
|
||||
if (nd->nd_flag & ND_NFSV3)
|
||||
@ -1789,7 +1791,7 @@ nfsrvd_mkdir(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
return (0);
|
||||
}
|
||||
if (dirp != NULL)
|
||||
dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, p);
|
||||
dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, p, 0);
|
||||
|
||||
/*
|
||||
* Call nfsrvd_mkdirsub() for the code common to V4 as well.
|
||||
@ -1836,7 +1838,7 @@ nfsrvd_mkdirsub(struct nfsrv_descript *nd, struct nameidata *ndp,
|
||||
nd->nd_repstat = nfsvno_getfh(vp, fhp, p);
|
||||
if (!(nd->nd_flag & ND_NFSV4) && !nd->nd_repstat)
|
||||
nd->nd_repstat = nfsvno_getattr(vp, nvap, nd->nd_cred,
|
||||
p);
|
||||
p, 1);
|
||||
if (vpp && !nd->nd_repstat) {
|
||||
NFSVOPUNLOCK(vp, 0, p);
|
||||
*vpp = vp;
|
||||
@ -1845,7 +1847,7 @@ nfsrvd_mkdirsub(struct nfsrv_descript *nd, struct nameidata *ndp,
|
||||
}
|
||||
}
|
||||
if (dirp) {
|
||||
*diraft_retp = nfsvno_getattr(dirp, diraftp, nd->nd_cred, p);
|
||||
*diraft_retp = nfsvno_getattr(dirp, diraftp, nd->nd_cred, p, 0);
|
||||
vrele(dirp);
|
||||
}
|
||||
if ((nd->nd_flag & ND_NFSV4) && !nd->nd_repstat) {
|
||||
@ -1883,10 +1885,10 @@ nfsrvd_commit(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
tl += 2;
|
||||
cnt = fxdr_unsigned(int, *tl);
|
||||
if (nd->nd_flag & ND_NFSV3)
|
||||
for_ret = nfsvno_getattr(vp, &bfor, nd->nd_cred, p);
|
||||
for_ret = nfsvno_getattr(vp, &bfor, nd->nd_cred, p, 1);
|
||||
nd->nd_repstat = nfsvno_fsync(vp, off, cnt, nd->nd_cred, p);
|
||||
if (nd->nd_flag & ND_NFSV3) {
|
||||
aft_ret = nfsvno_getattr(vp, &aft, nd->nd_cred, p);
|
||||
aft_ret = nfsvno_getattr(vp, &aft, nd->nd_cred, p, 1);
|
||||
nfsrv_wcc(nd, for_ret, &bfor, aft_ret, &aft);
|
||||
}
|
||||
vput(vp);
|
||||
@ -1921,7 +1923,7 @@ nfsrvd_statfs(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
}
|
||||
sf = &sfs;
|
||||
nd->nd_repstat = nfsvno_statfs(vp, sf);
|
||||
getret = nfsvno_getattr(vp, &at, nd->nd_cred, p);
|
||||
getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1);
|
||||
vput(vp);
|
||||
if (nd->nd_flag & ND_NFSV3)
|
||||
nfsrv_postopattr(nd, getret, &at);
|
||||
@ -1972,7 +1974,7 @@ nfsrvd_fsinfo(struct nfsrv_descript *nd, int isdgram,
|
||||
nfsrv_postopattr(nd, getret, &at);
|
||||
return (0);
|
||||
}
|
||||
getret = nfsvno_getattr(vp, &at, nd->nd_cred, p);
|
||||
getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1);
|
||||
nfsvno_getfs(&fs, isdgram);
|
||||
vput(vp);
|
||||
nfsrv_postopattr(nd, getret, &at);
|
||||
@ -2019,7 +2021,7 @@ nfsrvd_pathconf(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = nfsvno_pathconf(vp, _PC_NO_TRUNC, ¬runc,
|
||||
nd->nd_cred, p);
|
||||
getret = nfsvno_getattr(vp, &at, nd->nd_cred, p);
|
||||
getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1);
|
||||
vput(vp);
|
||||
nfsrv_postopattr(nd, getret, &at);
|
||||
if (!nd->nd_repstat) {
|
||||
@ -2516,7 +2518,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
|
||||
create = fxdr_unsigned(int, *tl);
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = nfsvno_getattr(dp, &dirfor, nd->nd_cred, p);
|
||||
nd->nd_repstat = nfsvno_getattr(dp, &dirfor, nd->nd_cred, p, 0);
|
||||
if (create == NFSV4OPEN_CREATE) {
|
||||
nva.na_type = VREG;
|
||||
nva.na_mode = 0;
|
||||
@ -2710,7 +2712,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
}
|
||||
|
||||
if (!nd->nd_repstat) {
|
||||
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p);
|
||||
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
|
||||
if (!nd->nd_repstat) {
|
||||
tverf[0] = nva.na_atime.tv_sec;
|
||||
tverf[1] = nva.na_atime.tv_nsec;
|
||||
@ -2736,7 +2738,8 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
if (stp)
|
||||
FREE((caddr_t)stp, M_NFSDSTATE);
|
||||
if (!nd->nd_repstat && dirp)
|
||||
nd->nd_repstat = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p);
|
||||
nd->nd_repstat = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p,
|
||||
0);
|
||||
if (!nd->nd_repstat) {
|
||||
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 6 * NFSX_UNSIGNED);
|
||||
*tl++ = txdr_unsigned(stateid.seqid);
|
||||
@ -3348,7 +3351,7 @@ nfsrvd_verify(struct nfsrv_descript *nd, int isdgram,
|
||||
struct nfsfsinfo fs;
|
||||
fhandle_t fh;
|
||||
|
||||
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p);
|
||||
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
|
||||
if (!nd->nd_repstat)
|
||||
nd->nd_repstat = nfsvno_statfs(vp, &sf);
|
||||
if (!nd->nd_repstat)
|
||||
|
Loading…
Reference in New Issue
Block a user