summaryrefslogtreecommitdiff
path: root/sys/nfs/nqnfs.h
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-03-31 13:16:48 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-03-31 13:16:48 +0000
commit21504931d6eeb371924b7751ab95d7209ef959db (patch)
treed80b42388119345065cd25ccf71050a3ed63ae26 /sys/nfs/nqnfs.h
parent633344117da42400851635ede8dd4464fb125ae7 (diff)
From NetBSD: NFSv3 import (tomorrow's Net's kernel)
Open's patches kept in. i'll possibly take a look at Lite2 soon, is there smth usefull ?..
Diffstat (limited to 'sys/nfs/nqnfs.h')
-rw-r--r--sys/nfs/nqnfs.h51
1 files changed, 32 insertions, 19 deletions
diff --git a/sys/nfs/nqnfs.h b/sys/nfs/nqnfs.h
index 728f8d1ab65..aa91fa3f768 100644
--- a/sys/nfs/nqnfs.h
+++ b/sys/nfs/nqnfs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: nqnfs.h,v 1.5 1995/12/19 23:08:21 cgd Exp $ */
+/* $NetBSD: nqnfs.h,v 1.6 1996/02/18 11:54:10 fvdl Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -35,9 +35,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)nqnfs.h 8.2 (Berkeley) 8/18/94
+ * @(#)nqnfs.h 8.3 (Berkeley) 3/30/95
*/
+
+#ifndef _NFS_NQNFS_H_
+#define _NFS_NQNFS_H_
+
/*
* Definitions for NQNFS (Not Quite NFS) cache consistency protocol.
*/
@@ -56,7 +60,7 @@
#define NQLCHSZ 256 /* Server hash table size */
#define NQNFS_PROG 300105 /* As assigned by Sun */
-#define NQNFS_VER1 1
+#define NQNFS_VER3 3
#define NQNFS_EVICTSIZ 156 /* Size of eviction request in bytes */
/*
@@ -64,6 +68,9 @@
* RAM on the server. The default definitions below assume that NOVRAM is not
* available.
*/
+#ifdef HASNVRAM
+# undef HASNVRAM
+#endif
#define NQSTORENOVRAM(t)
#define NQLOADNOVRAM(t)
@@ -83,7 +90,7 @@ struct nqhost {
union {
struct {
u_int16_t udp_flag;
- u_int16_t udp_port;
+ u_int16_t udp_port;
union nethostaddr udp_haddr;
} un_udp;
struct {
@@ -138,14 +145,6 @@ struct nqm {
};
/*
- * Flag bits for flags argument to nqsrv_getlease.
- */
-#define NQL_READ LEASE_READ /* Read Request */
-#define NQL_WRITE LEASE_WRITE /* Write Request */
-#define NQL_CHECK 0x4 /* Check for lease */
-#define NQL_NOVAL 0xffffffff /* Invalid */
-
-/*
* Special value for slp for local server calls.
*/
#define NQLOCALSLP ((struct nfssvc_sock *) -1)
@@ -155,9 +154,9 @@ struct nqm {
*/
#define nqsrv_getl(v, l) \
(void) nqsrv_getlease((v), &nfsd->nd_duration, \
- ((nfsd->nd_nqlflag != 0 && nfsd->nd_nqlflag != NQL_NOVAL) ? nfsd->nd_nqlflag : \
- ((l) | NQL_CHECK)), \
- nfsd, nam, &cache, &frev, cred)
+ ((nfsd->nd_flag & ND_LEASE) ? (nfsd->nd_flag & ND_LEASE) : \
+ ((l) | ND_CHECK)), \
+ slp, procp, nfsd->nd_nam, &cache, &frev, cred)
/*
* Client side macros that check for a valid lease.
@@ -165,13 +164,13 @@ struct nqm {
#define NQNFS_CKINVALID(v, n, f) \
((time.tv_sec > (n)->n_expiry && \
VFSTONFS((v)->v_mount)->nm_timeouts < VFSTONFS((v)->v_mount)->nm_deadthresh) \
- || ((f) == NQL_WRITE && ((n)->n_flag & NQNFSWRITE) == 0))
+ || ((f) == ND_WRITE && ((n)->n_flag & NQNFSWRITE) == 0))
#define NQNFS_CKCACHABLE(v, f) \
((time.tv_sec <= VTONFS(v)->n_expiry || \
VFSTONFS((v)->v_mount)->nm_timeouts >= VFSTONFS((v)->v_mount)->nm_deadthresh) \
&& (VTONFS(v)->n_flag & NQNFSNONCACHE) == 0 && \
- ((f) == NQL_READ || (VTONFS(v)->n_flag & NQNFSWRITE)))
+ ((f) == ND_READ || (VTONFS(v)->n_flag & NQNFSWRITE)))
#define NQNFS_NEEDLEASE(v, p) \
(time.tv_sec > VTONFS(v)->n_expiry ? \
@@ -179,7 +178,7 @@ struct nqm {
(((time.tv_sec + NQ_RENEWAL) > VTONFS(v)->n_expiry && \
nqnfs_piggy[p]) ? \
((VTONFS(v)->n_flag & NQNFSWRITE) ? \
- NQL_WRITE : nqnfs_piggy[p]) : 0))
+ ND_WRITE : nqnfs_piggy[p]) : 0))
/*
* List head for timer queue.
@@ -199,4 +198,18 @@ u_long nqfhhash;
*/
#define NQNFS_EXPIRED 500
#define NQNFS_TRYLATER 501
-#define NQNFS_AUTHERR 502
+
+#ifdef _KERNEL
+void nqnfs_lease_updatetime __P((int));
+int nqsrv_cmpnam __P((struct nfssvc_sock *,struct mbuf *,struct nqhost *));
+int nqsrv_getlease __P((struct vnode *, u_int32_t *, int,
+ struct nfssvc_sock *, struct proc *, struct mbuf *, int *,
+ u_quad_t *, struct ucred *));
+int nqnfs_getlease __P((struct vnode *, int, struct ucred *,struct proc *));
+int nqnfs_callback __P((struct nfsmount *, struct mbuf *, struct mbuf *,
+ caddr_t));
+int nqnfs_clientd __P((struct nfsmount *, struct ucred *,
+ struct nfsd_cargs *, int, caddr_t, struct proc *));
+#endif
+
+#endif