xref: /original-bsd/sys/nfs/nfsmount.h (revision b3f911e0)
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  *	@(#)nfsmount.h	7.4 (Berkeley) 05/04/90
21  */
22 
23 /*
24  * Mount structure.
25  * One allocated on every NFS mount.
26  * Holds NFS specific information for mount.
27  */
28 struct	nfsmount {
29 	int	nm_flag;		/* Flags for soft/hard... */
30 	struct	mount *nm_mountp;	/* Vfs structure for this filesystem */
31 	nfsv2fh_t nm_fh;		/* File handle of root dir */
32 	struct	socket	*nm_so;		/* Rpc socket */
33 	struct	nfshost *nm_hostinfo;	/* Host and congestion information */
34 	short	nm_retry;		/* Max retry count */
35 	short	nm_rexmit;		/* Rexmit on previous request */
36 	short	nm_rtt;			/* Round trip timer ticks @ NFS_HZ */
37 	short	nm_rto;			/* Current timeout */
38 	short	nm_srtt;		/* Smoothed round trip time */
39 	short	nm_rttvar;		/* RTT variance */
40 	int	nm_rsize;		/* Max size of read rpc */
41 	int	nm_wsize;		/* Max size of write rpc */
42 };
43 
44 /*
45  * Hostinfo/congestion structure.
46  * One allocated per NFS server.
47  * Holds host address, congestion limits, request count, etc.
48  * Reference count is of nfsmounts which point to it.
49  */
50 struct nfshost {
51 	struct	nfshost *nh_next, *nh_prev;
52 	short	nh_refcnt;		/* Reference count */
53 	short	nh_currto;		/* Current rto of any nfsmount */
54 	short	nh_currexmit;		/* Max rexmit count of nfsmounts */
55 	short	nh_sent;		/* Request send count */
56 	short	nh_window;		/* Request send window (max) */
57 	short	nh_winext;		/* Window incremental value */
58 	short	nh_ssthresh;		/* Slowstart threshold */
59 	short	nh_salen;		/* Actual length of nh_sockaddr */
60 	struct	mbuf *nh_sockaddr;	/* Address of server */
61 };
62 
63 #ifdef KERNEL
64 /*
65  * Convert mount ptr to nfsmount ptr.
66  */
67 #define VFSTONFS(mp)	((struct nfsmount *)((mp)->mnt_data))
68 #endif /* KERNEL */
69