From: Kirk McKusick Date: Thu, 9 May 1991 12:48:22 +0000 (-0800) Subject: enable the ability to avoid doing locking X-Git-Tag: BSD-4_4-Snapshot-Development~10680 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/43084f3887512f14e158b4816000c87aae7300ee enable the ability to avoid doing locking SCCS-vsn: sys/nfs/nfs_node.c 7.33 --- diff --git a/usr/src/sys/nfs/nfs_node.c b/usr/src/sys/nfs/nfs_node.c index 26596a920b..39e84012b6 100644 --- a/usr/src/sys/nfs/nfs_node.c +++ b/usr/src/sys/nfs/nfs_node.c @@ -7,7 +7,7 @@ * * %sccs.include.redist.c% * - * @(#)nfs_node.c 7.32 (Berkeley) %G% + * @(#)nfs_node.c 7.33 (Berkeley) %G% */ #include "param.h" @@ -213,14 +213,22 @@ nfs_reclaim(vp) return (0); } +/* + * In theory, NFS does not need locking, but we make provision + * for doing it just in case it is needed. + */ +int donfslocking = 0; /* * Lock an nfsnode */ + nfs_lock(vp) struct vnode *vp; { register struct nfsnode *np = VTONFS(vp); + if (!donfslocking) + return; while (np->n_flag & NLOCKED) { np->n_flag |= NWANT; if (np->n_lockholder == curproc->p_pid) @@ -241,8 +249,6 @@ nfs_unlock(vp) { register struct nfsnode *np = VTONFS(vp); - if ((np->n_flag & NLOCKED) == 0) - vprint("nfs_unlock: unlocked nfsnode", vp); np->n_lockholder = 0; np->n_flag &= ~NLOCKED; if (np->n_flag & NWANT) {