diff options
author | John Dyson <dyson@FreeBSD.org> | 1996-08-21 21:56:23 +0000 |
---|---|---|
committer | John Dyson <dyson@FreeBSD.org> | 1996-08-21 21:56:23 +0000 |
commit | 6476c0d204848007fc6da182e3935f01e267d77f (patch) | |
tree | 07a76a1b97882ad9c1e3805d05f820bc976c60bd /sys/nfsclient/nfs_subs.c | |
parent | fe6869c2d0e28a9e4e6af9bcaf8f65506ac68e86 (diff) | |
download | src-6476c0d204848007fc6da182e3935f01e267d77f.tar.gz src-6476c0d204848007fc6da182e3935f01e267d77f.zip |
Even though this looks like it, this is not a complex code change.
The interface into the "VMIO" system has changed to be more consistant
and robust. Essentially, it is now no longer necessary to call vn_open
to get merged VM/Buffer cache operation, and exceptional conditions
such as merged operation of VBLK devices is simpler and more correct.
This code corrects a potentially large set of problems including the
problems with ktrace output and loaded systems, file create/deletes,
etc.
Most of the changes to NFS are cosmetic and name changes, eliminating
a layer of subroutine calls. The direct calls to vput/vrele have
been re-instituted for better cross platform compatibility.
Reviewed by: davidg
Notes
Notes:
svn path=/head/; revision=17761
Diffstat (limited to 'sys/nfsclient/nfs_subs.c')
-rw-r--r-- | sys/nfsclient/nfs_subs.c | 55 |
1 files changed, 6 insertions, 49 deletions
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index 528815342c51..c45e50260a7e 100644 --- a/sys/nfsclient/nfs_subs.c +++ b/sys/nfsclient/nfs_subs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.30 1996/06/23 17:19:25 bde Exp $ + * $Id: nfs_subs.c,v 1.31 1996/07/16 10:19:44 dfr Exp $ */ /* @@ -1486,7 +1486,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag) nam, &rdonly, kerbflag)) goto out; if (dp->v_type != VDIR) { - nfsrv_vrele(dp); + vrele(dp); error = ENOTDIR; goto out; } @@ -1517,7 +1517,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag) goto out; } - nfsrv_vmio(ndp->ni_vp); + nfsrv_object_create(ndp->ni_vp); /* * Check for saved name request @@ -1748,7 +1748,7 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag) else *rdonlyp = 0; - nfsrv_vmio(*vpp); + nfsrv_object_create(*vpp); if (!lockflag) VOP_UNLOCK(*vpp); @@ -1940,53 +1940,10 @@ nfsrv_errmap(nd, err) } int -nfsrv_vmio(struct vnode *vp) { - vm_object_t object; +nfsrv_object_create(struct vnode *vp) { if ((vp == NULL) || (vp->v_type != VREG)) return 1; - -retry: - if ((vp->v_flag & VVMIO) == 0) { - struct vattr vat; - struct proc *p = curproc; - - if (VOP_GETATTR(vp, &vat, p->p_ucred, p) != 0) - panic("nfsrv_vmio: VOP_GETATTR failed"); - - (void) vnode_pager_alloc(vp, OFF_TO_IDX(round_page(vat.va_size)), 0, 0); - - vp->v_flag |= VVMIO; - } else { - if ((object = vp->v_object) && - (object->flags & OBJ_DEAD)) { - tsleep(object, PVM, "nfdead", 0); - goto retry; - } - if (!object) - panic("nfsrv_vmio: VMIO object missing"); - vm_object_reference(object); - } - return 0; -} -int -nfsrv_vput(struct vnode *vp) { - if ((vp->v_flag & VVMIO) && vp->v_object) { - vput(vp); - vm_object_deallocate(vp->v_object); - } else { - vput(vp); - } - return 0; -} -int -nfsrv_vrele(struct vnode *vp) { - if ((vp->v_flag & VVMIO) && vp->v_object) { - vrele(vp); - vm_object_deallocate(vp->v_object); - } else { - vrele(vp); - } - return 0; + return vfs_object_create(vp, curproc, curproc?curproc->p_ucred:NULL, 1); } #endif /* NFS_NOSERVER */ |