summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_vnops.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-10-06 20:23:17 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-10-06 20:23:17 +0000
commit85674180ac0b414993bec634994ea51b28390306 (patch)
tree5ce384dfed739e368b8605fc6db4ed1f26a43609 /sys/nfs/nfs_vnops.c
parent44f83f3e77b70fbce9f014e39cf5c97bae700213 (diff)
back out vfs lite2 till after 2.2
Diffstat (limited to 'sys/nfs/nfs_vnops.c')
-rw-r--r--sys/nfs/nfs_vnops.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 6bc7ad11c12..38682121192 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.16 1997/10/06 15:23:45 csapuntz Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.17 1997/10/06 20:20:54 deraadt Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -103,7 +103,9 @@ struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = {
{ &vop_lease_desc, nfs_lease_check }, /* lease */
{ &vop_ioctl_desc, nfs_ioctl }, /* ioctl */
{ &vop_select_desc, nfs_select }, /* select */
+#ifdef Lite2_integrated
{ &vop_revoke_desc, nfs_revoke }, /* revoke */
+#endif
{ &vop_mmap_desc, nfs_mmap }, /* mmap */
{ &vop_fsync_desc, nfs_fsync }, /* fsync */
{ &vop_seek_desc, nfs_seek }, /* seek */
@@ -157,7 +159,9 @@ struct vnodeopv_entry_desc spec_nfsv2nodeop_entries[] = {
{ &vop_lease_desc, spec_lease_check }, /* lease */
{ &vop_ioctl_desc, spec_ioctl }, /* ioctl */
{ &vop_select_desc, spec_select }, /* select */
+#ifdef Lite2_integrated
{ &vop_revoke_desc, spec_revoke }, /* revoke */
+#endif
{ &vop_mmap_desc, spec_mmap }, /* mmap */
{ &vop_fsync_desc, nfs_fsync }, /* fsync */
{ &vop_seek_desc, spec_seek }, /* seek */
@@ -209,7 +213,9 @@ struct vnodeopv_entry_desc fifo_nfsv2nodeop_entries[] = {
{ &vop_lease_desc, fifo_lease_check }, /* lease */
{ &vop_ioctl_desc, fifo_ioctl }, /* ioctl */
{ &vop_select_desc, fifo_select }, /* select */
+#ifdef Lite2_integrated
{ &vop_revoke_desc, fifo_revoke }, /* revoke */
+#endif
{ &vop_mmap_desc, fifo_mmap }, /* mmap */
{ &vop_fsync_desc, nfs_fsync }, /* fsync */
{ &vop_seek_desc, fifo_seek }, /* seek */
@@ -766,7 +772,6 @@ nfs_lookup(v)
register struct componentname *cnp = ap->a_cnp;
register struct vnode *dvp = ap->a_dvp;
register struct vnode **vpp = ap->a_vpp;
- struct proc *p = cnp->cn_proc;
register int flags = cnp->cn_flags;
register struct vnode *newvp;
register u_int32_t *tl;
@@ -805,8 +810,11 @@ nfs_lookup(v)
VREF(newvp);
error = 0;
} else
+#ifdef Lite2_integrated
error = vget(newvp, LK_EXCLUSIVE, p);
-
+#else
+ error = vget(newvp, 1);
+#endif
if (!error) {
if (vpid == newvp->v_id) {
if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred, cnp->cn_proc)
@@ -1956,17 +1964,11 @@ nfs_readdir(v)
if (!error && ap->a_cookies) {
struct dirent *dp;
- u_long *cookies;
- /* XXX - over-estimate - see UFS code for how to do it
- right */
- int ncookies = (uio->uio_iov->iov_base - base) / 12;
-
- MALLOC(cookies, u_long *, sizeof(*cookies) * ncookies,
- M_TEMP, M_WAITOK);
- *ap->a_ncookies = ncookies;
- *ap->a_cookies = cookies;
+ u_long *cookies = ap->a_cookies;
+ int ncookies = ap->a_ncookies;
- /* Only the NFS server and emulations use cookies, and they
+ /*
+ * Only the NFS server and emulations use cookies, and they
* load the directory block into system space, so we can
* just look at it directly.
*/
@@ -1980,8 +1982,6 @@ nfs_readdir(v)
*(cookies++) = off;
base += dp->d_reclen;
}
-
- *ap->a_ncookies -= ncookies;
uio->uio_resid += (uio->uio_iov->iov_base - base);
uio->uio_iov->iov_len += (uio->uio_iov->iov_base - base);
uio->uio_iov->iov_base = base;
@@ -2812,6 +2812,8 @@ again:
else {
vp->v_numoutput++;
bp->b_flags |= B_ASYNC;
+ if (bp->b_flags & B_DELWRI)
+ TAILQ_REMOVE(&bdirties, bp, b_synclist);
bp->b_flags &= ~(B_READ|B_DONE|B_ERROR|B_DELWRI);
bp->b_dirtyoff = bp->b_dirtyend = 0;
reassignbuf(bp, vp);
@@ -3090,6 +3092,8 @@ nfs_writebp(bp, force)
bp, bp->b_vp, bp->b_validoff, bp->b_validend, bp->b_dirtyoff,
bp->b_dirtyend);
#endif
+ if (bp->b_flags & B_DELWRI)
+ TAILQ_REMOVE(&bdirties, bp, b_synclist);
bp->b_flags &= ~(B_READ|B_DONE|B_ERROR|B_DELWRI);
if (oldflags & B_ASYNC) {