add islocked function to vnode switch
[unix-history] / usr / src / sys / nfs / nfs.h
CommitLineData
a2907882
KM
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 *
66435314 20 * @(#)nfs.h 7.4 (Berkeley) %G%
a2907882
KM
21 */
22
23/*
24 * Tunable constants for nfs
25 */
26#define MAX_IOVEC 10
36c3043b
KM
27#define NFS_TIMEO 10 /* Timeout in .1 sec intervals */
28#define NFS_MAXTIMEO 600 /* Max timeout to backoff too in .1 sec */
a2907882
KM
29#define NFS_ATTRTIMEO 5 /* Attribute cache timeout in sec */
30#define NFS_RETRANS 10 /* Num of retrans for soft mounts */
36c3043b
KM
31#define NFS_WSIZE 8192 /* Max. write data size <= 8192 */
32#define NFS_RSIZE 8192 /* Max. read data size <= 8192 */
a2907882 33#define MAX_READDIR NFS_RSIZE /* Max. size of directory read */
ffe6f482
KM
34#define MAX_ASYNCDAEMON 20 /* Max. number of async_daemons runnable */
35#define NMOD(a) ((a) % nfs_asyncdaemons)
a2907882
KM
36
37/*
38 * Nfs outstanding request list element
39 */
40struct 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;
ffe6f482 49 u_long r_inaddr;
a2907882
KM
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 */
59struct 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 */
72struct nfsstats {
73 int attrcache_hits;
74 int attrcache_misses;
75 int lookupcache_hits;
76 int lookupcache_misses;
66435314
KM
77 int biocache_reads;
78 int read_bios;
79 int read_physios;
80 int biocache_writes;
81 int write_bios;
82 int write_physios;
a2907882
KM
83 int rpccnt[NFS_NPROCS];
84 int rpcretries;
85 int srvrpccnt[NFS_NPROCS];
86 int srvrpc_errs;
87 int srv_errs;
66435314
KM
88 int srvcache_inproghits;
89 int srvcache_idemdonehits;
90 int srvcache_nonidemdonehits;
91 int srvcache_misses;
a2907882
KM
92};
93
94#ifdef KERNEL
95struct nfsstats nfsstats;
96#endif