summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_serv.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-02-10 02:22:35 +0000
committerdyson <dyson@FreeBSD.org>1997-02-10 02:22:35 +0000
commit10f666af84d48e89e4e2960415c9b616fce4077f (patch)
tree88a944de263165091f0a18abeedbaaccec532407 /sys/nfs/nfs_serv.c
parent0960d7e91af3428ffba89b42228d82d8afaa0389 (diff)
downloadFreeBSD-src-10f666af84d48e89e4e2960415c9b616fce4077f.zip
FreeBSD-src-10f666af84d48e89e4e2960415c9b616fce4077f.tar.gz
This is the kernel Lite/2 commit. There are some requisite userland
changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
Diffstat (limited to 'sys/nfs/nfs_serv.c')
-rw-r--r--sys/nfs/nfs_serv.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 3946778..28a705a 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -1723,7 +1723,7 @@ nfsrv_remove(nfsd, slp, procp, mrq)
}
out:
if (!error) {
- vnode_pager_uncache(vp);
+ vnode_pager_uncache(vp, procp);
nqsrv_getl(nd.ni_dvp, ND_WRITE);
nqsrv_getl(vp, ND_WRITE);
@@ -1900,7 +1900,7 @@ out:
nqsrv_getl(tdvp, ND_WRITE);
if (tvp) {
nqsrv_getl(tvp, ND_WRITE);
- (void) vnode_pager_uncache(tvp);
+ (void) vnode_pager_uncache(tvp, procp);
}
error = VOP_RENAME(fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd,
tond.ni_dvp, tond.ni_vp, &tond.ni_cnd);
@@ -2027,11 +2027,7 @@ out:
if (!error) {
nqsrv_getl(vp, ND_WRITE);
nqsrv_getl(xp, ND_WRITE);
-#if defined(__NetBSD__) || defined(__FreeBSD__)
- error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd);
-#else
error = VOP_LINK(vp, nd.ni_dvp, &nd.ni_cnd);
-#endif
} else {
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
if (nd.ni_dvp == nd.ni_vp)
@@ -2479,7 +2475,7 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
int siz, cnt, fullsiz, eofflag, rdonly, cache, ncookies;
int v3 = (nfsd->nd_flag & ND_NFSV3);
u_quad_t frev, off, toff, verf;
- u_int *cookies = NULL, *cookiep;
+ u_long *cookies = NULL, *cookiep;
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
@@ -2520,7 +2516,7 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
nfsm_srvpostop_attr(getret, &at);
return (0);
}
- VOP_UNLOCK(vp);
+ VOP_UNLOCK(vp, 0, procp);
MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK);
#ifdef __NetBSD__
ncookies = siz / (5 * NFSX_UNSIGNED); /*7 for V3, but it's an est. so*/
@@ -2538,16 +2534,12 @@ again:
io.uio_rw = UIO_READ;
io.uio_procp = (struct proc *)0;
eofflag = 0;
- VOP_LOCK(vp);
-#ifndef __NetBSD__
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, procp);
if (cookies) {
free((caddr_t)cookies, M_TEMP);
cookies = NULL;
}
error = VOP_READDIR(vp, &io, cred, &eofflag, &ncookies, &cookies);
-#else
- error = VOP_READDIR(vp, &io, cred, &eofflag, cookies, ncookies);
-#endif
off = (off_t)io.uio_offset;
if (!cookies && !error)
error = NFSERR_PERM;
@@ -2556,7 +2548,7 @@ again:
if (!error)
error = getret;
}
- VOP_UNLOCK(vp);
+ VOP_UNLOCK(vp, 0, procp);
if (error) {
vrele(vp);
free((caddr_t)rbuf, M_TEMP);
@@ -2751,7 +2743,7 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
int len, nlen, rem, xfer, tsiz, i, error = 0, getret = 1;
int siz, cnt, fullsiz, eofflag, rdonly, cache, dirlen, ncookies;
u_quad_t frev, off, toff, verf;
- u_int *cookies = NULL, *cookiep;
+ u_long *cookies = NULL, *cookiep;
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
@@ -2787,7 +2779,7 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
nfsm_srvpostop_attr(getret, &at);
return (0);
}
- VOP_UNLOCK(vp);
+ VOP_UNLOCK(vp, 0, procp);
MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK);
#ifdef __NetBSD__
ncookies = siz / (7 * NFSX_UNSIGNED);
@@ -2805,19 +2797,15 @@ again:
io.uio_rw = UIO_READ;
io.uio_procp = (struct proc *)0;
eofflag = 0;
- VOP_LOCK(vp);
-#ifndef __NetBSD__
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, procp);
if (cookies) {
free((caddr_t)cookies, M_TEMP);
cookies = NULL;
}
error = VOP_READDIR(vp, &io, cred, &eofflag, &ncookies, &cookies);
-#else
- error = VOP_READDIR(vp, &io, cred, &eofflag, cookies, ncookies);
-#endif
off = (u_quad_t)io.uio_offset;
getret = VOP_GETATTR(vp, &at, cred, procp);
- VOP_UNLOCK(vp);
+ VOP_UNLOCK(vp, 0, procp);
if (!cookies && !error)
error = NFSERR_PERM;
if (!error)
OpenPOWER on IntegriCloud