nfsmount.h revision 1.13 1 /* $NetBSD: nfsmount.h,v 1.13 1996/12/22 10:10:36 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.3 (Berkeley) 3/30/95
39 */
40
41
42 #ifndef _NFS_NFSMOUNT_H_
43 #define _NFS_NFSMOUNT_H_
44
45 /*
46 * Mount structure.
47 * One allocated on every NFS mount.
48 * Holds NFS specific information for mount.
49 */
50 struct nfsmount {
51 int nm_flag; /* Flags for soft/hard... */
52 struct mount *nm_mountp; /* Vfs structure for this filesystem */
53 int nm_numgrps; /* Max. size of groupslist */
54 u_char nm_fh[NFSX_V3FHMAX]; /* File handle of root dir */
55 int nm_fhsize; /* Size of root file handle */
56 struct socket *nm_so; /* Rpc socket */
57 int nm_sotype; /* Type of socket */
58 int nm_soproto; /* and protocol */
59 int nm_soflags; /* pr_flags for socket protocol */
60 struct mbuf *nm_nam; /* Addr of server */
61 int nm_timeo; /* Init timer for NFSMNT_DUMBTIMR */
62 int nm_retry; /* Max retries */
63 int nm_srtt[4]; /* Timers for rpcs */
64 int nm_sdrtt[4];
65 int nm_sent; /* Request send count */
66 int nm_cwnd; /* Request send window */
67 int nm_timeouts; /* Request timeouts */
68 int nm_deadthresh; /* Threshold of timeouts-->dead server*/
69 int nm_rsize; /* Max size of read rpc */
70 int nm_wsize; /* Max size of write rpc */
71 int nm_readdirsize; /* Size of a readdir rpc */
72 int nm_readahead; /* Num. of blocks to readahead */
73 int nm_leaseterm; /* Term (sec) for NQNFS lease */
74 CIRCLEQ_HEAD(, nfsnode) nm_timerhead; /* Head of lease timer queue */
75 struct vnode *nm_inprog; /* Vnode in prog by nqnfs_clientd() */
76 uid_t nm_authuid; /* Uid for authenticator */
77 int nm_authtype; /* Authenticator type */
78 int nm_authlen; /* and length */
79 char *nm_authstr; /* Authenticator string */
80 char *nm_verfstr; /* and the verifier */
81 int nm_verflen;
82 u_char nm_verf[NFSX_V3WRITEVERF]; /* V3 write verifier */
83 NFSKERBKEY_T nm_key; /* and the session key */
84 int nm_numuids; /* Number of nfsuid mappings */
85 TAILQ_HEAD(, nfsuid) nm_uidlruhead; /* Lists of nfsuid mappings */
86 LIST_HEAD(, nfsuid) nm_uidhashtbl[NFS_MUIDHASHSIZ];
87 TAILQ_HEAD(, buf) nm_bufq; /* async io buffer queue */
88 short nm_bufqlen; /* number of buffers in queue */
89 short nm_bufqwant; /* process wants to add to the queue */
90 int nm_bufqiods; /* number of iods processing queue */
91 };
92
93 #ifdef _KERNEL
94 /*
95 * Convert mount ptr to nfsmount ptr.
96 */
97 #define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data))
98 #endif /* _KERNEL */
99
100 /*
101 * Prototypes for NFS mount operations
102 */
103 int nfs_mount __P((struct mount *mp, const char *path, void *data,
104 struct nameidata *ndp, struct proc *p));
105 int mountnfs __P((struct nfs_args *argp, struct mount *mp,
106 struct mbuf *nam, const char *pth, const char *hst,
107 struct vnode **vpp));
108 int nfs_mountroot __P((void));
109 void nfs_decode_args __P((struct nfsmount *, struct nfs_args *));
110 int nfs_start __P((struct mount *mp, int flags, struct proc *p));
111 int nfs_unmount __P((struct mount *mp, int mntflags, struct proc *p));
112 int nfs_root __P((struct mount *mp, struct vnode **vpp));
113 int nfs_quotactl __P((struct mount *mp, int cmds, uid_t uid, caddr_t arg,
114 struct proc *p));
115 int nfs_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p));
116 int nfs_sync __P((struct mount *mp, int waitfor, struct ucred *cred,
117 struct proc *p));
118 int nfs_vget __P((struct mount *, ino_t, struct vnode **));
119 int nfs_fhtovp __P((struct mount *mp, struct fid *fhp, struct mbuf *nam,
120 struct vnode **vpp, int *exflagsp, struct ucred **credanonp));
121 int nfs_vptofh __P((struct vnode *vp, struct fid *fhp));
122 int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
123 struct proc *));
124 void nfs_vfs_init __P((void));
125
126 /*
127 * Prototypes for miscellaneous exported NFS functions.
128 */
129 void nfs_init __P((void));
130
131 #endif
132