xref: /csrg-svn/sys/nfs/nfs.h (revision 38414)
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.1 (Berkeley) 07/05/89
21  */
22 
23 /*
24  * Tunable constants for nfs
25  */
26 #define	MAX_IOVEC	10
27 #define	NFS_TIMEO	10	/* Timeout in .01 sec intervals */
28 #define	NFS_ATTRTIMEO	5	/* Attribute cache timeout in sec */
29 #define	NFS_RETRANS	10	/* Num of retrans for soft mounts */
30 #define	NFS_WSIZE	8196	/* Max. write data size <= 8192 */
31 #define	NFS_RSIZE	8196	/* Max. read data size <= 8192 */
32 #define	MAX_READDIR	NFS_RSIZE	/* Max. size of directory read */
33 
34 /*
35  * Nfs outstanding request list element
36  */
37 struct nfsreq {
38 	struct nfsreq	*r_next;
39 	struct nfsreq	*r_prev;
40 	struct mbuf	*r_mreq;
41 	struct mbuf	*r_mrep;
42 	struct nfsmount *r_mntp;
43 	struct vnode	*r_vp;
44 	int		r_msiz;
45 	u_long		r_xid;
46 	u_long		r_retry;
47 	u_long		r_timeout;
48 	u_long		r_timer;
49 };
50 
51 /*
52  * Silly rename structure that hangs off the nfsnode until the name
53  * can be removed by nfs_inactive()
54  */
55 struct sillyrename {
56 	int	s_flag;
57 	nfsv2fh_t s_fh;
58 	struct nameidata s_namei;
59 };
60 
61 /* And its flag values */
62 #define REMOVE		0
63 #define	RMDIR		1
64 
65 /*
66  * Stats structure
67  */
68 struct nfsstats {
69 	int	attrcache_hits;
70 	int	attrcache_misses;
71 	int	lookupcache_hits;
72 	int	lookupcache_misses;
73 	int	rpccnt[NFS_NPROCS];
74 	int	rpcretries;
75 	int	srvrpccnt[NFS_NPROCS];
76 	int	srvrpc_errs;
77 	int	srv_errs;
78 };
79 
80 #ifdef KERNEL
81 struct nfsstats nfsstats;
82 #endif
83