summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-08-21 21:56:23 +0000
committerdyson <dyson@FreeBSD.org>1996-08-21 21:56:23 +0000
commit966cbc5d29e66792108ec7d19f731b46d171245b (patch)
tree07a76a1b97882ad9c1e3805d05f820bc976c60bd /sys/nfsclient
parent2d0ae2fc91a319615c14ec10da1161bab780f734 (diff)
downloadFreeBSD-src-966cbc5d29e66792108ec7d19f731b46d171245b.zip
FreeBSD-src-966cbc5d29e66792108ec7d19f731b46d171245b.tar.gz
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
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs.h6
-rw-r--r--sys/nfsclient/nfs_subs.c55
-rw-r--r--sys/nfsclient/nfsargs.h6
-rw-r--r--sys/nfsclient/nfsstats.h6
4 files changed, 12 insertions, 61 deletions
diff --git a/sys/nfsclient/nfs.h b/sys/nfsclient/nfs.h
index 7f04283..3d9d801 100644
--- a/sys/nfsclient/nfs.h
+++ b/sys/nfsclient/nfs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.1 (Berkeley) 6/10/93
- * $Id: nfs.h,v 1.16 1995/12/17 21:12:05 phk Exp $
+ * $Id: nfs.h,v 1.17 1996/01/30 22:59:39 mpp Exp $
*/
#ifndef _NFS_NFS_H_
@@ -535,9 +535,7 @@ void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag));
void nfsrvw_sort __P((gid_t [],int));
void nfsrv_setcred __P((struct ucred *,struct ucred *));
int nfs_writebp __P((struct buf *,int));
-int nfsrv_vput __P(( struct vnode * ));
-int nfsrv_vrele __P(( struct vnode * ));
-int nfsrv_vmio __P(( struct vnode * ));
+int nfsrv_object_create __P(( struct vnode * ));
void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
struct proc *, struct mbuf **));
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c
index 5288153..c45e502 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 */
diff --git a/sys/nfsclient/nfsargs.h b/sys/nfsclient/nfsargs.h
index 7f04283..3d9d801 100644
--- a/sys/nfsclient/nfsargs.h
+++ b/sys/nfsclient/nfsargs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.1 (Berkeley) 6/10/93
- * $Id: nfs.h,v 1.16 1995/12/17 21:12:05 phk Exp $
+ * $Id: nfs.h,v 1.17 1996/01/30 22:59:39 mpp Exp $
*/
#ifndef _NFS_NFS_H_
@@ -535,9 +535,7 @@ void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag));
void nfsrvw_sort __P((gid_t [],int));
void nfsrv_setcred __P((struct ucred *,struct ucred *));
int nfs_writebp __P((struct buf *,int));
-int nfsrv_vput __P(( struct vnode * ));
-int nfsrv_vrele __P(( struct vnode * ));
-int nfsrv_vmio __P(( struct vnode * ));
+int nfsrv_object_create __P(( struct vnode * ));
void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
struct proc *, struct mbuf **));
diff --git a/sys/nfsclient/nfsstats.h b/sys/nfsclient/nfsstats.h
index 7f04283..3d9d801 100644
--- a/sys/nfsclient/nfsstats.h
+++ b/sys/nfsclient/nfsstats.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.1 (Berkeley) 6/10/93
- * $Id: nfs.h,v 1.16 1995/12/17 21:12:05 phk Exp $
+ * $Id: nfs.h,v 1.17 1996/01/30 22:59:39 mpp Exp $
*/
#ifndef _NFS_NFS_H_
@@ -535,9 +535,7 @@ void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag));
void nfsrvw_sort __P((gid_t [],int));
void nfsrv_setcred __P((struct ucred *,struct ucred *));
int nfs_writebp __P((struct buf *,int));
-int nfsrv_vput __P(( struct vnode * ));
-int nfsrv_vrele __P(( struct vnode * ));
-int nfsrv_vmio __P(( struct vnode * ));
+int nfsrv_object_create __P(( struct vnode * ));
void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
struct proc *, struct mbuf **));
OpenPOWER on IntegriCloud