diff options
author | dg <dg@FreeBSD.org> | 1994-08-08 17:31:01 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-08-08 17:31:01 +0000 |
commit | 8c8cfc5c11ccc319e45a6e25c83d6411fcde8815 (patch) | |
tree | 5d69c503687db08e569f528d85a6f7cc1e2f6eed /sys/nfsclient | |
parent | 1f61f296f8d8bd9ef1bf86dc0394cc86811aad95 (diff) | |
download | FreeBSD-src-8c8cfc5c11ccc319e45a6e25c83d6411fcde8815.zip FreeBSD-src-8c8cfc5c11ccc319e45a6e25c83d6411fcde8815.tar.gz |
Made lockf advisory locking code generic (rather than ufs specific), and
use it in NFS. This is required both for diskless support and for POSIX
compliance. Note: the support in NFS is only for the local node.
Submitted by: based on work originally done by Yuval Yurom
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 11 | ||||
-rw-r--r-- | sys/nfsclient/nfsnode.h | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 6d7eb92..70a6a88 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94 - * $Id$ + * $Id: nfs_vnops.c,v 1.3 1994/08/02 07:52:18 davidg Exp $ */ /* @@ -54,6 +54,7 @@ #include <sys/vnode.h> #include <sys/map.h> #include <sys/dirent.h> +#include <sys/lockf.h> #include <vm/vm.h> @@ -2204,8 +2205,14 @@ nfs_advlock(ap) int a_flags; } */ *ap; { + register struct nfsnode *np = VTONFS(ap->a_vp); - return (EOPNOTSUPP); + /* + * The following kludge is to allow diskless support to work + * until a real NFS lockd is implemented. Basically, just pretend + * that this is a local lock. + */ + return (lf_advlock(ap, &(np->n_lockf), np->n_size)); } /* diff --git a/sys/nfsclient/nfsnode.h b/sys/nfsclient/nfsnode.h index 0fe5d48..f21f220 100644 --- a/sys/nfsclient/nfsnode.h +++ b/sys/nfsclient/nfsnode.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsnode.h 8.4 (Berkeley) 2/13/94 - * $Id$ + * $Id: nfsnode.h,v 1.2 1994/08/02 07:52:22 davidg Exp $ */ /* @@ -66,6 +66,7 @@ struct nfsnode { time_t n_attrstamp; /* Time stamp for cached attributes */ struct sillyrename *n_sillyrename; /* Ptr to silly rename struct */ u_quad_t n_size; /* Current size of file */ + struct lockf *n_lockf; /* Locking record of file */ int n_error; /* Save write error value */ u_long n_direofoffset; /* Dir. EOF offset cache */ time_t n_mtime; /* Prev modify time. */ |