nfsmount.h revision 1.5 1 /* $NetBSD: nfsmount.h,v 1.5 1994/06/29 06:42:34 cgd Exp $ */
2
3 /*
4 * Copyright (c) 1989, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Rick Macklem at The University of Guelph.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)nfsmount.h 8.1 (Berkeley) 6/10/93
39 */
40
41 /*
42 * Mount structure.
43 * One allocated on every NFS mount.
44 * Holds NFS specific information for mount.
45 */
46 struct nfsmount {
47 int nm_flag; /* Flags for soft/hard... */
48 struct mount *nm_mountp; /* Vfs structure for this filesystem */
49 int nm_numgrps; /* Max. size of groupslist */
50 nfsv2fh_t nm_fh; /* File handle of root dir */
51 struct socket *nm_so; /* Rpc socket */
52 int nm_sotype; /* Type of socket */
53 int nm_soproto; /* and protocol */
54 int nm_soflags; /* pr_flags for socket protocol */
55 struct mbuf *nm_nam; /* Addr of server */
56 int nm_timeo; /* Init timer for NFSMNT_DUMBTIMR */
57 int nm_retry; /* Max retries */
58 int nm_srtt[4]; /* Timers for rpcs */
59 int nm_sdrtt[4];
60 int nm_sent; /* Request send count */
61 int nm_cwnd; /* Request send window */
62 int nm_timeouts; /* Request timeouts */
63 int nm_deadthresh; /* Threshold of timeouts-->dead server*/
64 int nm_rsize; /* Max size of read rpc */
65 int nm_wsize; /* Max size of write rpc */
66 int nm_readahead; /* Num. of blocks to readahead */
67 int nm_leaseterm; /* Term (sec) for NQNFS lease */
68 struct nfsnode *nm_tnext; /* Head of lease timer queue */
69 struct nfsnode *nm_tprev;
70 struct vnode *nm_inprog; /* Vnode in prog by nqnfs_clientd() */
71 uid_t nm_authuid; /* Uid for authenticator */
72 int nm_authtype; /* Authenticator type */
73 int nm_authlen; /* and length */
74 char *nm_authstr; /* Authenticator string */
75 };
76
77 #ifdef KERNEL
78 /*
79 * Convert mount ptr to nfsmount ptr.
80 */
81 #define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data))
82 #endif /* KERNEL */
83
84 /*
85 * Prototypes for NFS mount operations
86 */
87 int nfs_mount __P((
88 struct mount *mp,
89 char *path,
90 caddr_t data,
91 struct nameidata *ndp,
92 struct proc *p));
93 int nfs_start __P((
94 struct mount *mp,
95 int flags,
96 struct proc *p));
97 int nfs_unmount __P((
98 struct mount *mp,
99 int mntflags,
100 struct proc *p));
101 int nfs_root __P((
102 struct mount *mp,
103 struct vnode **vpp));
104 int nfs_quotactl __P((
105 struct mount *mp,
106 int cmds,
107 uid_t uid,
108 caddr_t arg,
109 struct proc *p));
110 int nfs_statfs __P((
111 struct mount *mp,
112 struct statfs *sbp,
113 struct proc *p));
114 int nfs_sync __P((
115 struct mount *mp,
116 int waitfor,
117 struct ucred *cred,
118 struct proc *p));
119 int nfs_fhtovp __P((
120 struct mount *mp,
121 struct fid *fhp,
122 struct mbuf *nam,
123 struct vnode **vpp,
124 int *exflagsp,
125 struct ucred **credanonp));
126 int nfs_vptofh __P((
127 struct vnode *vp,
128 struct fid *fhp));
129 int nfs_init __P(());
130