xref: /original-bsd/sys/nfs/nfsmount.h (revision deff14a8)
1 /*
2  * Copyright (c) 1989, 1993
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  * %sccs.include.redist.c%
9  *
10  *	@(#)nfsmount.h	8.2 (Berkeley) 08/18/94
11  */
12 
13 /*
14  * Mount structure.
15  * One allocated on every NFS mount.
16  * Holds NFS specific information for mount.
17  */
18 struct	nfsmount {
19 	int	nm_flag;		/* Flags for soft/hard... */
20 	struct	mount *nm_mountp;	/* Vfs structure for this filesystem */
21 	int	nm_numgrps;		/* Max. size of groupslist */
22 	nfsv2fh_t nm_fh;		/* File handle of root dir */
23 	struct	socket *nm_so;		/* Rpc socket */
24 	int	nm_sotype;		/* Type of socket */
25 	int	nm_soproto;		/* and protocol */
26 	int	nm_soflags;		/* pr_flags for socket protocol */
27 	struct	mbuf *nm_nam;		/* Addr of server */
28 	int	nm_timeo;		/* Init timer for NFSMNT_DUMBTIMR */
29 	int	nm_retry;		/* Max retries */
30 	int	nm_srtt[4];		/* Timers for rpcs */
31 	int	nm_sdrtt[4];
32 	int	nm_sent;		/* Request send count */
33 	int	nm_cwnd;		/* Request send window */
34 	int	nm_timeouts;		/* Request timeouts */
35 	int	nm_deadthresh;		/* Threshold of timeouts-->dead server*/
36 	int	nm_rsize;		/* Max size of read rpc */
37 	int	nm_wsize;		/* Max size of write rpc */
38 	int	nm_readahead;		/* Num. of blocks to readahead */
39 	int	nm_leaseterm;		/* Term (sec) for NQNFS lease */
40 	CIRCLEQ_HEAD(nfsnodes, nfsnode) nm_timerhead; /* Lease timer queue */
41 	struct vnode *nm_inprog;	/* Vnode in prog by nqnfs_clientd() */
42 	uid_t	nm_authuid;		/* Uid for authenticator */
43 	int	nm_authtype;		/* Authenticator type */
44 	int	nm_authlen;		/* and length */
45 	char	*nm_authstr;		/* Authenticator string */
46 };
47 
48 #ifdef KERNEL
49 /*
50  * Convert mount ptr to nfsmount ptr.
51  */
52 #define VFSTONFS(mp)	((struct nfsmount *)((mp)->mnt_data))
53 #endif /* KERNEL */
54 
55 /*
56  * Prototypes for NFS mount operations
57  */
58 int	nfs_mount __P((
59 		struct mount *mp,
60 		char *path,
61 		caddr_t data,
62 		struct nameidata *ndp,
63 		struct proc *p));
64 int	nfs_start __P((
65 		struct mount *mp,
66 		int flags,
67 		struct proc *p));
68 int	nfs_unmount __P((
69 		struct mount *mp,
70 		int mntflags,
71 		struct proc *p));
72 int	nfs_root __P((
73 		struct mount *mp,
74 		struct vnode **vpp));
75 int	nfs_quotactl __P((
76 		struct mount *mp,
77 		int cmds,
78 		uid_t uid,
79 		caddr_t arg,
80 		struct proc *p));
81 int	nfs_statfs __P((
82 		struct mount *mp,
83 		struct statfs *sbp,
84 		struct proc *p));
85 int	nfs_sync __P((
86 		struct mount *mp,
87 		int waitfor,
88 		struct ucred *cred,
89 		struct proc *p));
90 int	nfs_fhtovp __P((
91 		struct mount *mp,
92 		struct fid *fhp,
93 		struct mbuf *nam,
94 		struct vnode **vpp,
95 		int *exflagsp,
96 		struct ucred **credanonp));
97 int	nfs_vptofh __P((
98 		struct vnode *vp,
99 		struct fid *fhp));
100 int	nfs_init __P(());
101