Deleted Added
full compact
nfs.h (34961) nfs.h (36176)
1/*
2 * Copyright (c) 1989, 1993, 1995
3 * The Regents of the University of California. 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, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs.h 8.4 (Berkeley) 5/1/95
1/*
2 * Copyright (c) 1989, 1993, 1995
3 * The Regents of the University of California. 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, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs.h 8.4 (Berkeley) 5/1/95
37 * $Id: nfs.h,v 1.33 1998/02/01 21:23:29 bde Exp $
37 * $Id: nfs.h,v 1.34 1998/03/30 09:53:43 phk Exp $
38 */
39
40#ifndef _NFS_NFS_H_
41#define _NFS_NFS_H_
42
43/*
44 * Tunable constants for nfs
45 */

--- 5 unchanged lines hidden (view full) ---

51#define NFS_MINTIMEO (1 * NFS_HZ) /* Min timeout to use */
52#define NFS_MAXTIMEO (60 * NFS_HZ) /* Max timeout to backoff to */
53#define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/
54#define NFS_MAXREXMIT 100 /* Stop counting after this many */
55#define NFS_MAXWINDOW 1024 /* Max number of outstanding requests */
56#define NFS_RETRANS 10 /* Num of retrans for soft mounts */
57#define NFS_MAXGRPS 16 /* Max. size of groups list */
58#ifndef NFS_MINATTRTIMO
38 */
39
40#ifndef _NFS_NFS_H_
41#define _NFS_NFS_H_
42
43/*
44 * Tunable constants for nfs
45 */

--- 5 unchanged lines hidden (view full) ---

51#define NFS_MINTIMEO (1 * NFS_HZ) /* Min timeout to use */
52#define NFS_MAXTIMEO (60 * NFS_HZ) /* Max timeout to backoff to */
53#define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/
54#define NFS_MAXREXMIT 100 /* Stop counting after this many */
55#define NFS_MAXWINDOW 1024 /* Max number of outstanding requests */
56#define NFS_RETRANS 10 /* Num of retrans for soft mounts */
57#define NFS_MAXGRPS 16 /* Max. size of groups list */
58#ifndef NFS_MINATTRTIMO
59#define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */
59#define NFS_MINATTRTIMO 3 /* VREG attrib cache timeout in sec */
60#endif
61#ifndef NFS_MAXATTRTIMO
62#define NFS_MAXATTRTIMO 60
63#endif
60#endif
61#ifndef NFS_MAXATTRTIMO
62#define NFS_MAXATTRTIMO 60
63#endif
64#ifndef NFS_MINDIRATTRTIMO
65#define NFS_MINDIRATTRTIMO 30 /* VDIR attrib cache timeout in sec */
66#endif
67#ifndef NFS_MAXDIRATTRTIMO
68#define NFS_MAXDIRATTRTIMO 60
69#endif
64#define NFS_WSIZE 8192 /* Def. write data size <= 8192 */
65#define NFS_RSIZE 8192 /* Def. read data size <= 8192 */
66#define NFS_READDIRSIZE 8192 /* Def. readdir size */
67#define NFS_DEFRAHEAD 1 /* Def. read ahead # blocks */
68#define NFS_MAXRAHEAD 4 /* Max. read ahead # blocks */
69#define NFS_MAXUIDHASH 64 /* Max. # of hashed uid entries/mp */
70#define NFS_MAXASYNCDAEMON 20 /* Max. number async_daemons runnable */
71#define NFS_MAXGATHERDELAY 100 /* Max. write gather delay (msec) */

--- 27 unchanged lines hidden (view full) ---

99 * The IO_METASYNC flag should be implemented for local file systems.
100 * (Until then, it is nothin at all.)
101 */
102#ifndef IO_METASYNC
103#define IO_METASYNC 0
104#endif
105
106/*
70#define NFS_WSIZE 8192 /* Def. write data size <= 8192 */
71#define NFS_RSIZE 8192 /* Def. read data size <= 8192 */
72#define NFS_READDIRSIZE 8192 /* Def. readdir size */
73#define NFS_DEFRAHEAD 1 /* Def. read ahead # blocks */
74#define NFS_MAXRAHEAD 4 /* Max. read ahead # blocks */
75#define NFS_MAXUIDHASH 64 /* Max. # of hashed uid entries/mp */
76#define NFS_MAXASYNCDAEMON 20 /* Max. number async_daemons runnable */
77#define NFS_MAXGATHERDELAY 100 /* Max. write gather delay (msec) */

--- 27 unchanged lines hidden (view full) ---

105 * The IO_METASYNC flag should be implemented for local file systems.
106 * (Until then, it is nothin at all.)
107 */
108#ifndef IO_METASYNC
109#define IO_METASYNC 0
110#endif
111
112/*
107 * Set the attribute timeout based on how recently the file has been modified.
108 */
109#define NFS_ATTRTIMEO(np) \
110 ((((np)->n_flag & NMODIFIED) || \
111 (time_second - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \
112 ((time_second - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \
113 (time_second - (np)->n_mtime) / 10))
114
115/*
116 * Expected allocation sizes for major data structures. If the actual size
117 * of the structure exceeds these sizes, then malloc() will be allocating
118 * almost twice the memory required. This is used in nfs_init() to warn
119 * the sysadmin that the size of a structure should be reduced.
120 * (These sizes are always a power of 2. If the kernel malloc() changes
121 * to one that does not allocate space in powers of 2 size, then this all
122 * becomes bunk!)
123 */

--- 20 unchanged lines hidden (view full) ---

144 int readdirsize; /* readdir size in bytes */
145 int timeo; /* initial timeout in .1 secs */
146 int retrans; /* times to retry send */
147 int maxgrouplist; /* Max. size of group list */
148 int readahead; /* # of blocks to readahead */
149 int leaseterm; /* Term (sec) of lease */
150 int deadthresh; /* Retrans threshold */
151 char *hostname; /* server's name */
113 * Expected allocation sizes for major data structures. If the actual size
114 * of the structure exceeds these sizes, then malloc() will be allocating
115 * almost twice the memory required. This is used in nfs_init() to warn
116 * the sysadmin that the size of a structure should be reduced.
117 * (These sizes are always a power of 2. If the kernel malloc() changes
118 * to one that does not allocate space in powers of 2 size, then this all
119 * becomes bunk!)
120 */

--- 20 unchanged lines hidden (view full) ---

141 int readdirsize; /* readdir size in bytes */
142 int timeo; /* initial timeout in .1 secs */
143 int retrans; /* times to retry send */
144 int maxgrouplist; /* Max. size of group list */
145 int readahead; /* # of blocks to readahead */
146 int leaseterm; /* Term (sec) of lease */
147 int deadthresh; /* Retrans threshold */
148 char *hostname; /* server's name */
149 int acregmin; /* cache attrs for reg files min time */
150 int acregmax; /* cache attrs for reg files max time */
151 int acdirmin; /* cache attrs for dirs min time */
152 int acdirmax; /* cache attrs for dirs max time */
152};
153
154/*
155 * NFS mount option flags
156 */
157#define NFSMNT_SOFT 0x00000001 /* soft mount (hard is default) */
158#define NFSMNT_WSIZE 0x00000002 /* set write size */
159#define NFSMNT_RSIZE 0x00000004 /* set read size */

--- 7 unchanged lines hidden (view full) ---

167#define NFSMNT_KERB 0x00000400 /* Use Kerberos authentication */
168#define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */
169#define NFSMNT_LEASETERM 0x00001000 /* set lease term (nqnfs) */
170#define NFSMNT_READAHEAD 0x00002000 /* set read ahead */
171#define NFSMNT_DEADTHRESH 0x00004000 /* set dead server retry thresh */
172#define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */
173#define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */
174#define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */
153};
154
155/*
156 * NFS mount option flags
157 */
158#define NFSMNT_SOFT 0x00000001 /* soft mount (hard is default) */
159#define NFSMNT_WSIZE 0x00000002 /* set write size */
160#define NFSMNT_RSIZE 0x00000004 /* set read size */

--- 7 unchanged lines hidden (view full) ---

168#define NFSMNT_KERB 0x00000400 /* Use Kerberos authentication */
169#define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */
170#define NFSMNT_LEASETERM 0x00001000 /* set lease term (nqnfs) */
171#define NFSMNT_READAHEAD 0x00002000 /* set read ahead */
172#define NFSMNT_DEADTHRESH 0x00004000 /* set dead server retry thresh */
173#define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */
174#define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */
175#define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */
175#define NFSMNT_INTERNAL 0xfffc0000 /* Bits set internally */
176#define NFSMNT_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */
177#define NFSMNT_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */
178#define NFSMNT_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */
179#define NFSMNT_MNTD 0x00200000 /* Mnt server for mnt point */
180#define NFSMNT_DISMINPROG 0x00400000 /* Dismount in progress */
181#define NFSMNT_DISMNT 0x00800000 /* Dismounted */
182#define NFSMNT_SNDLOCK 0x01000000 /* Send socket lock */
183#define NFSMNT_WANTSND 0x02000000 /* Want above */
184#define NFSMNT_RCVLOCK 0x04000000 /* Rcv socket lock */
185#define NFSMNT_WANTRCV 0x08000000 /* Want above */
186#define NFSMNT_WAITAUTH 0x10000000 /* Wait for authentication */
187#define NFSMNT_HASAUTH 0x20000000 /* Has authenticator */
188#define NFSMNT_WANTAUTH 0x40000000 /* Wants an authenticator */
189#define NFSMNT_AUTHERR 0x80000000 /* Authentication error */
176#define NFSMNT_ACREGMIN 0x00040000
177#define NFSMNT_ACREGMAX 0x00080000
178#define NFSMNT_ACDIRMIN 0x00100000
179#define NFSMNT_ACDIRMAX 0x00200000
190
180
181#define NFSSTA_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */
182#define NFSSTA_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */
183#define NFSSTA_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */
184#define NFSSTA_MNTD 0x00200000 /* Mnt server for mnt point */
185#define NFSSTA_DISMINPROG 0x00400000 /* Dismount in progress */
186#define NFSSTA_DISMNT 0x00800000 /* Dismounted */
187#define NFSSTA_SNDLOCK 0x01000000 /* Send socket lock */
188#define NFSSTA_WANTSND 0x02000000 /* Want above */
189#define NFSSTA_RCVLOCK 0x04000000 /* Rcv socket lock */
190#define NFSSTA_WANTRCV 0x08000000 /* Want above */
191#define NFSSTA_WAITAUTH 0x10000000 /* Wait for authentication */
192#define NFSSTA_HASAUTH 0x20000000 /* Has authenticator */
193#define NFSSTA_WANTAUTH 0x40000000 /* Wants an authenticator */
194#define NFSSTA_AUTHERR 0x80000000 /* Authentication error */
195
191/*
192 * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs
193 * should ever try and use it.
194 */
195struct nfsd_args {
196 int sock; /* Socket to serve */
197 caddr_t name; /* Client addr for connection based sockets */
198 int namelen; /* Length of name */

--- 376 unchanged lines hidden (view full) ---

575int nfs_init __P((struct vfsconf *vfsp));
576int nfs_reply __P((struct nfsreq *));
577int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
578int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *,
579 struct nfsreq *));
580int nfs_rephead __P((int, struct nfsrv_descript *, struct nfssvc_sock *,
581 int, int, u_quad_t *, struct mbuf **, struct mbuf **,
582 caddr_t *));
196/*
197 * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs
198 * should ever try and use it.
199 */
200struct nfsd_args {
201 int sock; /* Socket to serve */
202 caddr_t name; /* Client addr for connection based sockets */
203 int namelen; /* Length of name */

--- 376 unchanged lines hidden (view full) ---

580int nfs_init __P((struct vfsconf *vfsp));
581int nfs_reply __P((struct nfsreq *));
582int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
583int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *,
584 struct nfsreq *));
585int nfs_rephead __P((int, struct nfsrv_descript *, struct nfssvc_sock *,
586 int, int, u_quad_t *, struct mbuf **, struct mbuf **,
587 caddr_t *));
583int nfs_sndlock __P((int *, struct nfsreq *));
584void nfs_sndunlock __P((int *flagp));
588int nfs_sndlock __P((int *, int *, struct nfsreq *));
589void nfs_sndunlock __P((int *, int *));
585int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
586int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *,
587 int));
588int nfs_readrpc __P((struct vnode *, struct uio *, struct ucred *));
589int nfs_writerpc __P((struct vnode *, struct uio *, struct ucred *, int *,
590 int *));
591int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *));
592int nfs_asyncio __P((struct buf *, struct ucred *));

--- 125 unchanged lines hidden ---
590int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
591int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *,
592 int));
593int nfs_readrpc __P((struct vnode *, struct uio *, struct ucred *));
594int nfs_writerpc __P((struct vnode *, struct uio *, struct ucred *, int *,
595 int *));
596int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *));
597int nfs_asyncio __P((struct buf *, struct ucred *));

--- 125 unchanged lines hidden ---