xref: /openbsd/sys/nfs/nfsmount.h (revision 94f656b1)
1*94f656b1Smpi /*	$OpenBSD: nfsmount.h,v 1.28 2018/04/09 09:39:53 mpi Exp $	*/
278530d46Smickey /*	$NetBSD: nfsmount.h,v 1.10 1996/02/18 11:54:03 fvdl Exp $	*/
3df930be7Sderaadt 
4df930be7Sderaadt /*
5df930be7Sderaadt  * Copyright (c) 1989, 1993
6df930be7Sderaadt  *	The Regents of the University of California.  All rights reserved.
7df930be7Sderaadt  *
8df930be7Sderaadt  * This code is derived from software contributed to Berkeley by
9df930be7Sderaadt  * Rick Macklem at The University of Guelph.
10df930be7Sderaadt  *
11df930be7Sderaadt  * Redistribution and use in source and binary forms, with or without
12df930be7Sderaadt  * modification, are permitted provided that the following conditions
13df930be7Sderaadt  * are met:
14df930be7Sderaadt  * 1. Redistributions of source code must retain the above copyright
15df930be7Sderaadt  *    notice, this list of conditions and the following disclaimer.
16df930be7Sderaadt  * 2. Redistributions in binary form must reproduce the above copyright
17df930be7Sderaadt  *    notice, this list of conditions and the following disclaimer in the
18df930be7Sderaadt  *    documentation and/or other materials provided with the distribution.
1929295d1cSmillert  * 3. Neither the name of the University nor the names of its contributors
20df930be7Sderaadt  *    may be used to endorse or promote products derived from this software
21df930be7Sderaadt  *    without specific prior written permission.
22df930be7Sderaadt  *
23df930be7Sderaadt  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24df930be7Sderaadt  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25df930be7Sderaadt  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26df930be7Sderaadt  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27df930be7Sderaadt  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28df930be7Sderaadt  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29df930be7Sderaadt  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30df930be7Sderaadt  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31df930be7Sderaadt  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32df930be7Sderaadt  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33df930be7Sderaadt  * SUCH DAMAGE.
34df930be7Sderaadt  *
3578530d46Smickey  *	@(#)nfsmount.h	8.3 (Berkeley) 3/30/95
36df930be7Sderaadt  */
37df930be7Sderaadt 
3878530d46Smickey 
3978530d46Smickey #ifndef _NFS_NFSMOUNT_H_
4078530d46Smickey #define _NFS_NFSMOUNT_H_
4178530d46Smickey 
42df930be7Sderaadt /*
43df930be7Sderaadt  * Mount structure.
44df930be7Sderaadt  * One allocated on every NFS mount.
45df930be7Sderaadt  * Holds NFS specific information for mount.
46df930be7Sderaadt  */
47df930be7Sderaadt struct	nfsmount {
48b78d9702Sdlg 	RBT_HEAD(nfs_nodetree, nfsnode)
49e54eb321Sthib 		nm_ntree;		/* filehandle/node tree */
50004f2c04Sthib 	TAILQ_HEAD(reqs, nfsreq)
51004f2c04Sthib 		nm_reqsq;		/* request queue for this mount. */
52004f2c04Sthib 	struct	timeout nm_rtimeout;	/* timeout (scans/resends nm_reqsq). */
53df930be7Sderaadt 	struct	mount *nm_mountp;	/* Vfs structure for this filesystem */
54*94f656b1Smpi 	struct	vnode *nm_vnode;	/* vnode of root dir */
55*94f656b1Smpi 	int	nm_flag;		/* Flags for soft/hard... */
56df930be7Sderaadt 	int	nm_numgrps;		/* Max. size of groupslist */
57df930be7Sderaadt 	struct	socket *nm_so;		/* Rpc socket */
58df930be7Sderaadt 	int	nm_sotype;		/* Type of socket */
59df930be7Sderaadt 	int	nm_soproto;		/* and protocol */
60df930be7Sderaadt 	int	nm_soflags;		/* pr_flags for socket protocol */
61df930be7Sderaadt 	struct	mbuf *nm_nam;		/* Addr of server */
62df930be7Sderaadt 	int	nm_timeo;		/* Init timer for NFSMNT_DUMBTIMR */
63df930be7Sderaadt 	int	nm_retry;		/* Max retries */
64ee815122Sthib 	int	nm_srtt[NFS_MAX_TIMER];	/* RTT Timers for RPCs */
65ee815122Sthib 	int	nm_sdrtt[NFS_MAX_TIMER];
66df930be7Sderaadt 	int	nm_sent;		/* Request send count */
67df930be7Sderaadt 	int	nm_cwnd;		/* Request send window */
68df930be7Sderaadt 	int	nm_timeouts;		/* Request timeouts */
69df930be7Sderaadt 	int	nm_rsize;		/* Max size of read rpc */
70df930be7Sderaadt 	int	nm_wsize;		/* Max size of write rpc */
7178530d46Smickey 	int	nm_readdirsize;		/* Size of a readdir rpc */
72df930be7Sderaadt 	int	nm_readahead;		/* Num. of blocks to readahead */
7378530d46Smickey 	u_char	nm_verf[NFSX_V3WRITEVERF]; /* V3 write verifier */
7483393f7eSdm 	u_short	nm_acregmin;		/* Attr cache file recently modified */
7583393f7eSdm 	u_short	nm_acregmax;		/* ac file not recently modified */
7683393f7eSdm 	u_short	nm_acdirmin;		/* ac for dir recently modified */
7783393f7eSdm 	u_short	nm_acdirmax;		/* ac for dir not recently modified */
78df930be7Sderaadt };
79df930be7Sderaadt 
80df930be7Sderaadt #ifdef _KERNEL
81df930be7Sderaadt 
82348c0620Sthib /* Convert mount ptr to nfsmount ptr: */
83348c0620Sthib #define VFSTONFS(mp)	((struct nfsmount *)((mp)->mnt_data))
84348c0620Sthib 
85348c0620Sthib /* Prototypes for NFS mount operations: */
86003008acSthib int	nfs_mount(struct mount *, const char *, void *, struct nameidata *,
87003008acSthib 	    struct proc *);
88c4071fd1Smillert int	nfs_fsinfo(struct nfsmount *, struct vnode *, struct ucred *,
89c4071fd1Smillert 	    struct proc *);
90c4071fd1Smillert void	nfs_init(void);
91370decb4Sniklas 
92348c0620Sthib #endif /* _KERNEL */
93348c0620Sthib 
9478530d46Smickey #endif
95