diff options
| author | 2001-11-27 05:27:11 +0000 | |
|---|---|---|
| committer | 2001-11-27 05:27:11 +0000 | |
| commit | 5af79db257c43883165df4d19734148ccfcdd5e8 (patch) | |
| tree | 1d787f45797cd1ab6c09e667f6b1a5a28e8351e5 /sys/nfs/nfs_node.c | |
| parent | Move the declaration of EH_DEBUG and ERRATA__XXX_USR to the kernel (diff) | |
| download | wireguard-openbsd-5af79db257c43883165df4d19734148ccfcdd5e8.tar.xz wireguard-openbsd-5af79db257c43883165df4d19734148ccfcdd5e8.zip | |
Merge in the unified buffer cache code as found in NetBSD 2001/03/10. The
code is written mostly by Chuck Silvers <chuq@chuq.com>/<chs@netbsd.org>.
Tested for the past few weeks by many developers, should be in a pretty stable
state, but will require optimizations and additional cleanups.
Diffstat (limited to 'sys/nfs/nfs_node.c')
| -rw-r--r-- | sys/nfs/nfs_node.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c index 987259eadc3..567738584da 100644 --- a/sys/nfs/nfs_node.c +++ b/sys/nfs/nfs_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_node.c,v 1.16 2001/11/15 23:15:15 art Exp $ */ +/* $OpenBSD: nfs_node.c,v 1.17 2001/11/27 05:27:12 art Exp $ */ /* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */ /* @@ -145,6 +145,7 @@ loop: vp = nvp; np = pool_get(&nfs_node_pool, PR_WAITOK); bzero((caddr_t)np, sizeof *np); + lockinit(&np->n_commitlock, PINOD, "nfsclock", 0, 0); vp->v_data = np; np->n_vnode = vp; @@ -169,6 +170,17 @@ loop: np->n_fhp = &np->n_fh; bcopy((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize); np->n_fhsize = fhsize; + + /* + * XXXUBC doing this while holding the nfs_hashlock is bad, + * but there's no alternative at the moment. + */ + error = VOP_GETATTR(vp, &np->n_vattr, curproc->p_ucred, curproc); + if (error) { + return error; + } + uvm_vnp_setsize(vp, np->n_vattr.va_size); + lockmgr(&nfs_hashlock, LK_RELEASE, 0, p); *npp = np; return (0); @@ -185,11 +197,12 @@ nfs_inactive(v) struct nfsnode *np; struct sillyrename *sp; struct proc *p = curproc; /* XXX */ + struct vnode *vp = ap->a_vp; - np = VTONFS(ap->a_vp); - if (prtactive && ap->a_vp->v_usecount != 0) - vprint("nfs_inactive: pushing active", ap->a_vp); - if (ap->a_vp->v_type != VDIR) { + np = VTONFS(vp); + if (prtactive && vp->v_usecount != 0) + vprint("nfs_inactive: pushing active", vp); + if (vp->v_type != VDIR) { sp = np->n_sillyrename; np->n_sillyrename = (struct sillyrename *)0; } else @@ -198,7 +211,7 @@ nfs_inactive(v) /* * Remove the silly file that was rename'd earlier */ - (void) nfs_vinvalbuf(ap->a_vp, 0, sp->s_cred, p, 1); + (void) nfs_vinvalbuf(vp, 0, sp->s_cred, p, 1); nfs_removeit(sp); crfree(sp->s_cred); vrele(sp->s_dvp); @@ -206,7 +219,7 @@ nfs_inactive(v) } np->n_flag &= (NMODIFIED | NFLUSHINPROG | NFLUSHWANT); - VOP_UNLOCK(ap->a_vp, 0, ap->a_p); + VOP_UNLOCK(vp, 0, ap->a_p); return (0); } |
