xref: /freebsd/sys/nfsclient/nfsmount.h (revision 7c1c33a7dd16e123fb836b48b7318eca0026d75e)
1df8bae1dSRodney W. Grimes /*
2df8bae1dSRodney W. Grimes  * Copyright (c) 1989, 1993
3df8bae1dSRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
4df8bae1dSRodney W. Grimes  *
5df8bae1dSRodney W. Grimes  * This code is derived from software contributed to Berkeley by
6df8bae1dSRodney W. Grimes  * Rick Macklem at The University of Guelph.
7df8bae1dSRodney W. Grimes  *
8df8bae1dSRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
9df8bae1dSRodney W. Grimes  * modification, are permitted provided that the following conditions
10df8bae1dSRodney W. Grimes  * are met:
11df8bae1dSRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
12df8bae1dSRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
13df8bae1dSRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
14df8bae1dSRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
15df8bae1dSRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
16df8bae1dSRodney W. Grimes  * 3. All advertising materials mentioning features or use of this software
17df8bae1dSRodney W. Grimes  *    must display the following acknowledgement:
18df8bae1dSRodney W. Grimes  *	This product includes software developed by the University of
19df8bae1dSRodney W. Grimes  *	California, Berkeley and its contributors.
20df8bae1dSRodney W. Grimes  * 4. Neither the name of the University nor the names of its contributors
21df8bae1dSRodney W. Grimes  *    may be used to endorse or promote products derived from this software
22df8bae1dSRodney W. Grimes  *    without specific prior written permission.
23df8bae1dSRodney W. Grimes  *
24df8bae1dSRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25df8bae1dSRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26df8bae1dSRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27df8bae1dSRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28df8bae1dSRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29df8bae1dSRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30df8bae1dSRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31df8bae1dSRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32df8bae1dSRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33df8bae1dSRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34df8bae1dSRodney W. Grimes  * SUCH DAMAGE.
35df8bae1dSRodney W. Grimes  *
36996c772fSJohn Dyson  *	@(#)nfsmount.h	8.3 (Berkeley) 3/30/95
377c1c33a7SPeter Wemm  * $Id: nfsmount.h,v 1.14 1998/05/19 07:11:27 peter Exp $
38df8bae1dSRodney W. Grimes  */
39df8bae1dSRodney W. Grimes 
40996c772fSJohn Dyson 
4133420ec6SPaul Richards #ifndef _NFS_NFSMOUNT_H_
4233420ec6SPaul Richards #define _NFS_NFSMOUNT_H_
4333420ec6SPaul Richards 
44df8bae1dSRodney W. Grimes /*
45df8bae1dSRodney W. Grimes  * Mount structure.
46df8bae1dSRodney W. Grimes  * One allocated on every NFS mount.
47df8bae1dSRodney W. Grimes  * Holds NFS specific information for mount.
48df8bae1dSRodney W. Grimes  */
49df8bae1dSRodney W. Grimes struct	nfsmount {
50df8bae1dSRodney W. Grimes 	int	nm_flag;		/* Flags for soft/hard... */
51fe6c0d45SPeter Wemm 	int	nm_state;		/* Internal state flags */
52df8bae1dSRodney W. Grimes 	struct	mount *nm_mountp;	/* Vfs structure for this filesystem */
53df8bae1dSRodney W. Grimes 	int	nm_numgrps;		/* Max. size of groupslist */
54a62dc406SDoug Rabson 	u_char	nm_fh[NFSX_V3FHMAX];	/* File handle of root dir */
55a62dc406SDoug Rabson 	int	nm_fhsize;		/* Size of root file handle */
56df8bae1dSRodney W. Grimes 	struct	socket *nm_so;		/* Rpc socket */
57df8bae1dSRodney W. Grimes 	int	nm_sotype;		/* Type of socket */
58df8bae1dSRodney W. Grimes 	int	nm_soproto;		/* and protocol */
59df8bae1dSRodney W. Grimes 	int	nm_soflags;		/* pr_flags for socket protocol */
6057bf258eSGarrett Wollman 	struct	sockaddr *nm_nam;	/* Addr of server */
61df8bae1dSRodney W. Grimes 	int	nm_timeo;		/* Init timer for NFSMNT_DUMBTIMR */
62df8bae1dSRodney W. Grimes 	int	nm_retry;		/* Max retries */
63df8bae1dSRodney W. Grimes 	int	nm_srtt[4];		/* Timers for rpcs */
64df8bae1dSRodney W. Grimes 	int	nm_sdrtt[4];
65df8bae1dSRodney W. Grimes 	int	nm_sent;		/* Request send count */
66df8bae1dSRodney W. Grimes 	int	nm_cwnd;		/* Request send window */
67df8bae1dSRodney W. Grimes 	int	nm_timeouts;		/* Request timeouts */
68df8bae1dSRodney W. Grimes 	int	nm_deadthresh;		/* Threshold of timeouts-->dead server*/
69df8bae1dSRodney W. Grimes 	int	nm_rsize;		/* Max size of read rpc */
70df8bae1dSRodney W. Grimes 	int	nm_wsize;		/* Max size of write rpc */
71a62dc406SDoug Rabson 	int	nm_readdirsize;		/* Size of a readdir rpc */
72df8bae1dSRodney W. Grimes 	int	nm_readahead;		/* Num. of blocks to readahead */
73df8bae1dSRodney W. Grimes 	int	nm_leaseterm;		/* Term (sec) for NQNFS lease */
74fe6c0d45SPeter Wemm 	int	nm_acdirmin;		/* Directory attr cache min lifetime */
75fe6c0d45SPeter Wemm 	int	nm_acdirmax;		/* Directory attr cache max lifetime */
76fe6c0d45SPeter Wemm 	int	nm_acregmin;		/* Reg file attr cache min lifetime */
77fe6c0d45SPeter Wemm 	int	nm_acregmax;		/* Reg file attr cache max lifetime */
786ae32407SPoul-Henning Kamp 	CIRCLEQ_HEAD(, nfsnode) nm_timerhead; /* Head of lease timer queue */
79df8bae1dSRodney W. Grimes 	struct vnode *nm_inprog;	/* Vnode in prog by nqnfs_clientd() */
80df8bae1dSRodney W. Grimes 	uid_t	nm_authuid;		/* Uid for authenticator */
81df8bae1dSRodney W. Grimes 	int	nm_authtype;		/* Authenticator type */
82df8bae1dSRodney W. Grimes 	int	nm_authlen;		/* and length */
83df8bae1dSRodney W. Grimes 	char	*nm_authstr;		/* Authenticator string */
84a62dc406SDoug Rabson 	char	*nm_verfstr;		/* and the verifier */
85a62dc406SDoug Rabson 	int	nm_verflen;
86a62dc406SDoug Rabson 	u_char	nm_verf[NFSX_V3WRITEVERF]; /* V3 write verifier */
87a62dc406SDoug Rabson 	NFSKERBKEY_T nm_key;		/* and the session key */
88a62dc406SDoug Rabson 	int	nm_numuids;		/* Number of nfsuid mappings */
89a62dc406SDoug Rabson 	TAILQ_HEAD(, nfsuid) nm_uidlruhead; /* Lists of nfsuid mappings */
90a62dc406SDoug Rabson 	LIST_HEAD(, nfsuid) nm_uidhashtbl[NFS_MUIDHASHSIZ];
91f438ae02SDoug Rabson 	TAILQ_HEAD(, buf) nm_bufq;	/* async io buffer queue */
92f438ae02SDoug Rabson 	short	nm_bufqlen;		/* number of buffers in queue */
93f438ae02SDoug Rabson 	short	nm_bufqwant;		/* process wants to add to the queue */
94f438ae02SDoug Rabson 	int	nm_bufqiods;		/* number of iods processing queue */
957c1c33a7SPeter Wemm 	u_int64_t nm_maxfilesize;	/* maximum file size */
96df8bae1dSRodney W. Grimes };
97df8bae1dSRodney W. Grimes 
98a62dc406SDoug Rabson #if defined(KERNEL) || defined(_KERNEL)
99df8bae1dSRodney W. Grimes /*
100df8bae1dSRodney W. Grimes  * Convert mount ptr to nfsmount ptr.
101df8bae1dSRodney W. Grimes  */
102df8bae1dSRodney W. Grimes #define VFSTONFS(mp)	((struct nfsmount *)((mp)->mnt_data))
103f438ae02SDoug Rabson 
104df8bae1dSRodney W. Grimes #endif /* KERNEL */
105df8bae1dSRodney W. Grimes 
10633420ec6SPaul Richards #endif
107