xref: /csrg-svn/sys/nfs/nfs.h (revision 39339)
1 /*
2  * Copyright (c) 1989 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Rick Macklem at The University of Guelph.
7  *
8  * Redistribution and use in source and binary forms are permitted
9  * provided that the above copyright notice and this paragraph are
10  * duplicated in all such forms and that any documentation,
11  * advertising materials, and other materials related to such
12  * distribution and use acknowledge that the software was developed
13  * by the University of California, Berkeley.  The name of the
14  * University may not be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19  *
20  *	@(#)nfs.h	7.3 (Berkeley) 10/19/89
21  */
22 
23 /*
24  * Tunable constants for nfs
25  */
26 #define	MAX_IOVEC	10
27 #define	NFS_TIMEO	10	/* Timeout in .1 sec intervals */
28 #define	NFS_MAXTIMEO	600	/* Max timeout to backoff too in .1 sec */
29 #define	NFS_ATTRTIMEO	5	/* Attribute cache timeout in sec */
30 #define	NFS_RETRANS	10	/* Num of retrans for soft mounts */
31 #define	NFS_WSIZE	8192	/* Max. write data size <= 8192 */
32 #define	NFS_RSIZE	8192	/* Max. read data size <= 8192 */
33 #define	MAX_READDIR	NFS_RSIZE	/* Max. size of directory read */
34 #define	MAX_ASYNCDAEMON	20	/* Max. number of async_daemons runnable */
35 #define	NMOD(a)		((a) % nfs_asyncdaemons)
36 
37 /*
38  * Nfs outstanding request list element
39  */
40 struct nfsreq {
41 	struct nfsreq	*r_next;
42 	struct nfsreq	*r_prev;
43 	struct mbuf	*r_mreq;
44 	struct mbuf	*r_mrep;
45 	struct nfsmount *r_mntp;
46 	struct vnode	*r_vp;
47 	int		r_msiz;
48 	u_long		r_xid;
49 	u_long		r_inaddr;
50 	u_long		r_retry;
51 	u_long		r_timeout;
52 	u_long		r_timer;
53 };
54 
55 /*
56  * Silly rename structure that hangs off the nfsnode until the name
57  * can be removed by nfs_inactive()
58  */
59 struct sillyrename {
60 	int	s_flag;
61 	nfsv2fh_t s_fh;
62 	struct nameidata s_namei;
63 };
64 
65 /* And its flag values */
66 #define REMOVE		0
67 #define	RMDIR		1
68 
69 /*
70  * Stats structure
71  */
72 struct nfsstats {
73 	int	attrcache_hits;
74 	int	attrcache_misses;
75 	int	lookupcache_hits;
76 	int	lookupcache_misses;
77 	int	rpccnt[NFS_NPROCS];
78 	int	rpcretries;
79 	int	srvrpccnt[NFS_NPROCS];
80 	int	srvrpc_errs;
81 	int	srv_errs;
82 };
83 
84 #ifdef KERNEL
85 struct nfsstats nfsstats;
86 #endif
87