xref: /original-bsd/sys/nfs/nfs.h (revision 0842ddeb)
1 /*
2  * Copyright (c) 1989, 1993, 1995
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  *	@(#)nfs.h	8.4 (Berkeley) 05/01/95
11  */
12 
13 #ifndef _NFS_NFS_H_
14 #define _NFS_NFS_H_
15 
16 /*
17  * Tunable constants for nfs
18  */
19 
20 #define	NFS_MAXIOVEC	34
21 #define NFS_TICKINTVL	5		/* Desired time for a tick (msec) */
22 #define NFS_HZ		(hz / nfs_ticks) /* Ticks/sec */
23 #define	NFS_TIMEO	(1 * NFS_HZ)	/* Default timeout = 1 second */
24 #define	NFS_MINTIMEO	(1 * NFS_HZ)	/* Min timeout to use */
25 #define	NFS_MAXTIMEO	(60 * NFS_HZ)	/* Max timeout to backoff to */
26 #define	NFS_MINIDEMTIMEO (5 * NFS_HZ)	/* Min timeout for non-idempotent ops*/
27 #define	NFS_MAXREXMIT	100		/* Stop counting after this many */
28 #define	NFS_MAXWINDOW	1024		/* Max number of outstanding requests */
29 #define	NFS_RETRANS	10		/* Num of retrans for soft mounts */
30 #define	NFS_MAXGRPS	16		/* Max. size of groups list */
31 #ifndef NFS_MINATTRTIMO
32 #define	NFS_MINATTRTIMO 5		/* Attribute cache timeout in sec */
33 #endif
34 #ifndef NFS_MAXATTRTIMO
35 #define	NFS_MAXATTRTIMO 60
36 #endif
37 #define	NFS_WSIZE	8192		/* Def. write data size <= 8192 */
38 #define	NFS_RSIZE	8192		/* Def. read data size <= 8192 */
39 #define NFS_READDIRSIZE	8192		/* Def. readdir size */
40 #define	NFS_DEFRAHEAD	1		/* Def. read ahead # blocks */
41 #define	NFS_MAXRAHEAD	4		/* Max. read ahead # blocks */
42 #define	NFS_MAXUIDHASH	64		/* Max. # of hashed uid entries/mp */
43 #define	NFS_MAXASYNCDAEMON 	20	/* Max. number async_daemons runable */
44 #define NFS_MAXGATHERDELAY	100	/* Max. write gather delay (msec) */
45 #ifndef NFS_GATHERDELAY
46 #define NFS_GATHERDELAY		10	/* Default write gather delay (msec) */
47 #endif
48 #define	NFS_DIRBLKSIZ	4096		/* Must be a multiple of DIRBLKSIZ */
49 
50 /*
51  * Oddballs
52  */
53 #define	NMOD(a)		((a) % nfs_asyncdaemons)
54 #define NFS_CMPFH(n, f, s) \
55 	((n)->n_fhsize == (s) && !bcmp((caddr_t)(n)->n_fhp, (caddr_t)(f), (s)))
56 #define NFS_ISV3(v)	(VFSTONFS((v)->v_mount)->nm_flag & NFSMNT_NFSV3)
57 #define NFS_SRVMAXDATA(n) \
58 		(((n)->nd_flag & ND_NFSV3) ? (((n)->nd_nam2) ? \
59 		 NFS_MAXDGRAMDATA : NFS_MAXDATA) : NFS_V2MAXDATA)
60 
61 /*
62  * XXX
63  * The B_INVAFTERWRITE flag should be set to whatever is required by the
64  * buffer cache code to say "Invalidate the block after it is written back".
65  */
66 #define	B_INVAFTERWRITE	B_INVAL
67 
68 /*
69  * The IO_METASYNC flag should be implemented for local file systems.
70  * (Until then, it is nothin at all.)
71  */
72 #ifndef IO_METASYNC
73 #define IO_METASYNC	0
74 #endif
75 
76 /*
77  * Set the attribute timeout based on how recently the file has been modified.
78  */
79 #define	NFS_ATTRTIMEO(np) \
80 	((((np)->n_flag & NMODIFIED) || \
81 	 (time.tv_sec - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \
82 	 ((time.tv_sec - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \
83 	  (time.tv_sec - (np)->n_mtime) / 10))
84 
85 /*
86  * Expected allocation sizes for major data structures. If the actual size
87  * of the structure exceeds these sizes, then malloc() will be allocating
88  * almost twice the memory required. This is used in nfs_init() to warn
89  * the sysadmin that the size of a structure should be reduced.
90  * (These sizes are always a power of 2. If the kernel malloc() changes
91  *  to one that does not allocate space in powers of 2 size, then this all
92  *  becomes bunk!)
93  */
94 #define NFS_NODEALLOC	256
95 #define NFS_MNTALLOC	512
96 #define NFS_SVCALLOC	256
97 #define NFS_UIDALLOC	128
98 
99 /*
100  * Arguments to mount NFS
101  */
102 #define NFS_ARGSVERSION	3		/* change when nfs_args changes */
103 struct nfs_args {
104 	int		version;	/* args structure version number */
105 	struct sockaddr	*addr;		/* file server address */
106 	int		addrlen;	/* length of address */
107 	int		sotype;		/* Socket type */
108 	int		proto;		/* and Protocol */
109 	u_char		*fh;		/* File handle to be mounted */
110 	int		fhsize;		/* Size, in bytes, of fh */
111 	int		flags;		/* flags */
112 	int		wsize;		/* write size in bytes */
113 	int		rsize;		/* read size in bytes */
114 	int		readdirsize;	/* readdir size in bytes */
115 	int		timeo;		/* initial timeout in .1 secs */
116 	int		retrans;	/* times to retry send */
117 	int		maxgrouplist;	/* Max. size of group list */
118 	int		readahead;	/* # of blocks to readahead */
119 	int		leaseterm;	/* Term (sec) of lease */
120 	int		deadthresh;	/* Retrans threshold */
121 	char		*hostname;	/* server's name */
122 };
123 
124 /*
125  * NFS mount option flags
126  */
127 #define	NFSMNT_SOFT		0x00000001  /* soft mount (hard is default) */
128 #define	NFSMNT_WSIZE		0x00000002  /* set write size */
129 #define	NFSMNT_RSIZE		0x00000004  /* set read size */
130 #define	NFSMNT_TIMEO		0x00000008  /* set initial timeout */
131 #define	NFSMNT_RETRANS		0x00000010  /* set number of request retries */
132 #define	NFSMNT_MAXGRPS		0x00000020  /* set maximum grouplist size */
133 #define	NFSMNT_INT		0x00000040  /* allow interrupts on hard mount */
134 #define	NFSMNT_NOCONN		0x00000080  /* Don't Connect the socket */
135 #define	NFSMNT_NQNFS		0x00000100  /* Use Nqnfs protocol */
136 #define	NFSMNT_NFSV3		0x00000200  /* Use NFS Version 3 protocol */
137 #define	NFSMNT_KERB		0x00000400  /* Use Kerberos authentication */
138 #define	NFSMNT_DUMBTIMR		0x00000800  /* Don't estimate rtt dynamically */
139 #define	NFSMNT_LEASETERM	0x00001000  /* set lease term (nqnfs) */
140 #define	NFSMNT_READAHEAD	0x00002000  /* set read ahead */
141 #define	NFSMNT_DEADTHRESH	0x00004000  /* set dead server retry thresh */
142 #define	NFSMNT_RESVPORT		0x00008000  /* Allocate a reserved port */
143 #define	NFSMNT_RDIRPLUS		0x00010000  /* Use Readdirplus for V3 */
144 #define	NFSMNT_READDIRSIZE	0x00020000  /* Set readdir size */
145 #define	NFSMNT_INTERNAL		0xfffc0000  /* Bits set internally */
146 #define NFSMNT_HASWRITEVERF	0x00040000  /* Has write verifier for V3 */
147 #define NFSMNT_GOTPATHCONF	0x00080000  /* Got the V3 pathconf info */
148 #define NFSMNT_GOTFSINFO	0x00100000  /* Got the V3 fsinfo */
149 #define	NFSMNT_MNTD		0x00200000  /* Mnt server for mnt point */
150 #define	NFSMNT_DISMINPROG	0x00400000  /* Dismount in progress */
151 #define	NFSMNT_DISMNT		0x00800000  /* Dismounted */
152 #define	NFSMNT_SNDLOCK		0x01000000  /* Send socket lock */
153 #define	NFSMNT_WANTSND		0x02000000  /* Want above */
154 #define	NFSMNT_RCVLOCK		0x04000000  /* Rcv socket lock */
155 #define	NFSMNT_WANTRCV		0x08000000  /* Want above */
156 #define	NFSMNT_WAITAUTH		0x10000000  /* Wait for authentication */
157 #define	NFSMNT_HASAUTH		0x20000000  /* Has authenticator */
158 #define	NFSMNT_WANTAUTH		0x40000000  /* Wants an authenticator */
159 #define	NFSMNT_AUTHERR		0x80000000  /* Authentication error */
160 
161 /*
162  * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs
163  * should ever try and use it.
164  */
165 struct nfsd_args {
166 	int	sock;		/* Socket to serve */
167 	caddr_t	name;		/* Client addr for connection based sockets */
168 	int	namelen;	/* Length of name */
169 };
170 
171 struct nfsd_srvargs {
172 	struct nfsd	*nsd_nfsd;	/* Pointer to in kernel nfsd struct */
173 	uid_t		nsd_uid;	/* Effective uid mapped to cred */
174 	u_long		nsd_haddr;	/* Ip address of client */
175 	struct ucred	nsd_cr;		/* Cred. uid maps to */
176 	int		nsd_authlen;	/* Length of auth string (ret) */
177 	u_char		*nsd_authstr;	/* Auth string (ret) */
178 	int		nsd_verflen;	/* and the verfier */
179 	u_char		*nsd_verfstr;
180 	struct timeval	nsd_timestamp;	/* timestamp from verifier */
181 	u_long		nsd_ttl;	/* credential ttl (sec) */
182 	NFSKERBKEY_T	nsd_key;	/* Session key */
183 };
184 
185 struct nfsd_cargs {
186 	char		*ncd_dirp;	/* Mount dir path */
187 	uid_t		ncd_authuid;	/* Effective uid */
188 	int		ncd_authtype;	/* Type of authenticator */
189 	int		ncd_authlen;	/* Length of authenticator string */
190 	u_char		*ncd_authstr;	/* Authenticator string */
191 	int		ncd_verflen;	/* and the verifier */
192 	u_char		*ncd_verfstr;
193 	NFSKERBKEY_T	ncd_key;	/* Session key */
194 };
195 
196 /*
197  * Stats structure
198  */
199 struct nfsstats {
200 	int	attrcache_hits;
201 	int	attrcache_misses;
202 	int	lookupcache_hits;
203 	int	lookupcache_misses;
204 	int	direofcache_hits;
205 	int	direofcache_misses;
206 	int	biocache_reads;
207 	int	read_bios;
208 	int	read_physios;
209 	int	biocache_writes;
210 	int	write_bios;
211 	int	write_physios;
212 	int	biocache_readlinks;
213 	int	readlink_bios;
214 	int	biocache_readdirs;
215 	int	readdir_bios;
216 	int	rpccnt[NFS_NPROCS];
217 	int	rpcretries;
218 	int	srvrpccnt[NFS_NPROCS];
219 	int	srvrpc_errs;
220 	int	srv_errs;
221 	int	rpcrequests;
222 	int	rpctimeouts;
223 	int	rpcunexpected;
224 	int	rpcinvalid;
225 	int	srvcache_inproghits;
226 	int	srvcache_idemdonehits;
227 	int	srvcache_nonidemdonehits;
228 	int	srvcache_misses;
229 	int	srvnqnfs_leases;
230 	int	srvnqnfs_maxleases;
231 	int	srvnqnfs_getleases;
232 	int	srvvop_writes;
233 };
234 
235 /*
236  * Flags for nfssvc() system call.
237  */
238 #define	NFSSVC_BIOD	0x002
239 #define	NFSSVC_NFSD	0x004
240 #define	NFSSVC_ADDSOCK	0x008
241 #define	NFSSVC_AUTHIN	0x010
242 #define	NFSSVC_GOTAUTH	0x040
243 #define	NFSSVC_AUTHINFAIL 0x080
244 #define	NFSSVC_MNTD	0x100
245 
246 /*
247  * fs.nfs sysctl(3) identifiers
248  */
249 #define NFS_NFSSTATS	1		/* struct: struct nfsstats */
250 
251 #define FS_NFS_NAMES { \
252 		       { 0, 0 }, \
253 		       { "nfsstats", CTLTYPE_STRUCT }, \
254 }
255 
256 /*
257  * The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts.
258  * What should be in this set is open to debate, but I believe that since
259  * I/O system calls on ufs are never interrupted by signals the set should
260  * be minimal. My reasoning is that many current programs that use signals
261  * such as SIGALRM will not expect file I/O system calls to be interrupted
262  * by them and break.
263  */
264 #ifdef KERNEL
265 
266 struct uio; struct buf; struct vattr; struct nameidata;	/* XXX */
267 
268 #define	NFSINT_SIGMASK	(sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \
269 			 sigmask(SIGHUP)|sigmask(SIGQUIT))
270 
271 /*
272  * Socket errors ignored for connectionless sockets??
273  * For now, ignore them all
274  */
275 #define	NFSIGNORE_SOERROR(s, e) \
276 		((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \
277 		((s) & PR_CONNREQUIRED) == 0)
278 
279 /*
280  * Nfs outstanding request list element
281  */
282 struct nfsreq {
283 	TAILQ_ENTRY(nfsreq) r_chain;
284 	struct mbuf	*r_mreq;
285 	struct mbuf	*r_mrep;
286 	struct mbuf	*r_md;
287 	caddr_t		r_dpos;
288 	struct nfsmount *r_nmp;
289 	struct vnode	*r_vp;
290 	u_long		r_xid;
291 	int		r_flags;	/* flags on request, see below */
292 	int		r_retry;	/* max retransmission count */
293 	int		r_rexmit;	/* current retrans count */
294 	int		r_timer;	/* tick counter on reply */
295 	int		r_procnum;	/* NFS procedure number */
296 	int		r_rtt;		/* RTT for rpc */
297 	struct proc	*r_procp;	/* Proc that did I/O system call */
298 };
299 
300 /*
301  * Queue head for nfsreq's
302  */
303 TAILQ_HEAD(, nfsreq) nfs_reqq;
304 
305 /* Flag values for r_flags */
306 #define R_TIMING	0x01		/* timing request (in mntp) */
307 #define R_SENT		0x02		/* request has been sent */
308 #define	R_SOFTTERM	0x04		/* soft mnt, too many retries */
309 #define	R_INTR		0x08		/* intr mnt, signal pending */
310 #define	R_SOCKERR	0x10		/* Fatal error on socket */
311 #define	R_TPRINTFMSG	0x20		/* Did a tprintf msg. */
312 #define	R_MUSTRESEND	0x40		/* Must resend request */
313 #define	R_GETONEREP	0x80		/* Probe for one reply only */
314 
315 /*
316  * A list of nfssvc_sock structures is maintained with all the sockets
317  * that require service by the nfsd.
318  * The nfsuid structs hang off of the nfssvc_sock structs in both lru
319  * and uid hash lists.
320  */
321 #ifndef NFS_UIDHASHSIZ
322 #define	NFS_UIDHASHSIZ	29	/* Tune the size of nfssvc_sock with this */
323 #endif
324 #define	NUIDHASH(sock, uid) \
325 	(&(sock)->ns_uidhashtbl[(uid) % NFS_UIDHASHSIZ])
326 #ifndef NFS_WDELAYHASHSIZ
327 #define	NFS_WDELAYHASHSIZ 16	/* and with this */
328 #endif
329 #define	NWDELAYHASH(sock, f) \
330 	(&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ])
331 #ifndef NFS_MUIDHASHSIZ
332 #define NFS_MUIDHASHSIZ	67	/* Tune the size of nfsmount with this */
333 #endif
334 #define	NMUIDHASH(nmp, uid) \
335 	(&(nmp)->nm_uidhashtbl[(uid) % NFS_MUIDHASHSIZ])
336 #define	NFSNOHASH(fhsum) \
337 	(&nfsnodehashtbl[(fhsum) & nfsnodehash])
338 
339 /*
340  * Network address hash list element
341  */
342 union nethostaddr {
343 	u_long had_inetaddr;
344 	struct mbuf *had_nam;
345 };
346 
347 struct nfsuid {
348 	TAILQ_ENTRY(nfsuid) nu_lru;	/* LRU chain */
349 	LIST_ENTRY(nfsuid) nu_hash;	/* Hash list */
350 	int		nu_flag;	/* Flags */
351 	union nethostaddr nu_haddr;	/* Host addr. for dgram sockets */
352 	struct ucred	nu_cr;		/* Cred uid mapped to */
353 	int		nu_expire;	/* Expiry time (sec) */
354 	struct timeval	nu_timestamp;	/* Kerb. timestamp */
355 	u_long		nu_nickname;	/* Nickname on server */
356 	NFSKERBKEY_T	nu_key;		/* and session key */
357 };
358 
359 #define	nu_inetaddr	nu_haddr.had_inetaddr
360 #define	nu_nam		nu_haddr.had_nam
361 /* Bits for nu_flag */
362 #define	NU_INETADDR	0x1
363 #define NU_NAM		0x2
364 #define NU_NETFAM(u)	(((u)->nu_flag & NU_INETADDR) ? AF_INET : AF_ISO)
365 
366 struct nfssvc_sock {
367 	TAILQ_ENTRY(nfssvc_sock) ns_chain;	/* List of all nfssvc_sock's */
368 	TAILQ_HEAD(, nfsuid) ns_uidlruhead;
369 	struct file	*ns_fp;
370 	struct socket	*ns_so;
371 	struct mbuf	*ns_nam;
372 	struct mbuf	*ns_raw;
373 	struct mbuf	*ns_rawend;
374 	struct mbuf	*ns_rec;
375 	struct mbuf	*ns_recend;
376 	struct mbuf	*ns_frag;
377 	int		ns_flag;
378 	int		ns_solock;
379 	int		ns_cc;
380 	int		ns_reclen;
381 	int		ns_numuids;
382 	u_long		ns_sref;
383 	LIST_HEAD(, nfsrv_descript) ns_tq;	/* Write gather lists */
384 	LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
385 	LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
386 };
387 
388 /* Bits for "ns_flag" */
389 #define	SLP_VALID	0x01
390 #define	SLP_DOREC	0x02
391 #define	SLP_NEEDQ	0x04
392 #define	SLP_DISCONN	0x08
393 #define	SLP_GETSTREAM	0x10
394 #define	SLP_LASTFRAG	0x20
395 #define SLP_ALLFLAGS	0xff
396 
397 TAILQ_HEAD(, nfssvc_sock) nfssvc_sockhead;
398 int nfssvc_sockhead_flag;
399 #define	SLP_INIT	0x01
400 #define	SLP_WANTINIT	0x02
401 
402 /*
403  * One of these structures is allocated for each nfsd.
404  */
405 struct nfsd {
406 	TAILQ_ENTRY(nfsd) nfsd_chain;	/* List of all nfsd's */
407 	int		nfsd_flag;	/* NFSD_ flags */
408 	struct nfssvc_sock *nfsd_slp;	/* Current socket */
409 	int		nfsd_authlen;	/* Authenticator len */
410 	u_char		nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */
411 	int		nfsd_verflen;	/* and the Verifier */
412 	u_char		nfsd_verfstr[RPCVERF_MAXSIZ];
413 	struct proc	*nfsd_procp;	/* Proc ptr */
414 	struct nfsrv_descript *nfsd_nd;	/* Associated nfsrv_descript */
415 };
416 
417 /* Bits for "nfsd_flag" */
418 #define	NFSD_WAITING	0x01
419 #define	NFSD_REQINPROG	0x02
420 #define	NFSD_NEEDAUTH	0x04
421 #define	NFSD_AUTHFAIL	0x08
422 
423 /*
424  * This structure is used by the server for describing each request.
425  * Some fields are used only when write request gathering is performed.
426  */
427 struct nfsrv_descript {
428 	u_quad_t		nd_time;	/* Write deadline (usec) */
429 	off_t			nd_off;		/* Start byte offset */
430 	off_t			nd_eoff;	/* and end byte offset */
431 	LIST_ENTRY(nfsrv_descript) nd_hash;	/* Hash list */
432 	LIST_ENTRY(nfsrv_descript) nd_tq;		/* and timer list */
433 	LIST_HEAD(,nfsrv_descript) nd_coalesce;	/* coalesced writes */
434 	struct mbuf		*nd_mrep;	/* Request mbuf list */
435 	struct mbuf		*nd_md;		/* Current dissect mbuf */
436 	struct mbuf		*nd_mreq;	/* Reply mbuf list */
437 	struct mbuf		*nd_nam;	/* and socket addr */
438 	struct mbuf		*nd_nam2;	/* return socket addr */
439 	caddr_t			nd_dpos;	/* Current dissect pos */
440 	int			nd_procnum;	/* RPC # */
441 	int			nd_stable;	/* storage type */
442 	int			nd_flag;	/* nd_flag */
443 	int			nd_len;		/* Length of this write */
444 	int			nd_repstat;	/* Reply status */
445 	u_long			nd_retxid;	/* Reply xid */
446 	u_long			nd_duration;	/* Lease duration */
447 	struct timeval		nd_starttime;	/* Time RPC initiated */
448 	fhandle_t		nd_fh;		/* File handle */
449 	struct ucred		nd_cr;		/* Credentials */
450 };
451 
452 /* Bits for "nd_flag" */
453 #define	ND_READ		LEASE_READ
454 #define ND_WRITE	LEASE_WRITE
455 #define ND_CHECK	0x04
456 #define ND_LEASE	(ND_READ | ND_WRITE | ND_CHECK)
457 #define ND_NFSV3	0x08
458 #define ND_NQNFS	0x10
459 #define ND_KERBNICK	0x20
460 #define ND_KERBFULL	0x40
461 #define ND_KERBAUTH	(ND_KERBNICK | ND_KERBFULL)
462 
463 TAILQ_HEAD(, nfsd) nfsd_head;
464 int nfsd_head_flag;
465 #define	NFSD_CHECKSLP	0x01
466 
467 /*
468  * These macros compare nfsrv_descript structures.
469  */
470 #define NFSW_CONTIG(o, n) \
471 		((o)->nd_eoff >= (n)->nd_off && \
472 		 !bcmp((caddr_t)&(o)->nd_fh, (caddr_t)&(n)->nd_fh, NFSX_V3FH))
473 
474 #define NFSW_SAMECRED(o, n) \
475 	(((o)->nd_flag & ND_KERBAUTH) == ((n)->nd_flag & ND_KERBAUTH) && \
476  	 !bcmp((caddr_t)&(o)->nd_cr, (caddr_t)&(n)->nd_cr, \
477 		sizeof (struct ucred)))
478 
479 int	nfs_reply __P((struct nfsreq *));
480 int	nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
481 int	nfs_send __P((struct socket *,struct mbuf *,struct mbuf *,struct nfsreq *));
482 int	nfs_rephead __P((int,struct nfsrv_descript *,struct nfssvc_sock *,int,int,u_quad_t *,struct mbuf **,struct mbuf **,caddr_t *));
483 int	nfs_sndlock __P((int *,struct nfsreq *));
484 int	nfs_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
485 int	nfs_vinvalbuf __P((struct vnode *,int,struct ucred *,struct proc *,int));
486 int	nfs_readrpc __P((struct vnode *,struct uio *,struct ucred *));
487 int	nfs_writerpc __P((struct vnode *,struct uio *,struct ucred *,int *,int *));
488 int	nfs_readdirrpc __P((register struct vnode *,struct uio *,struct ucred *));
489 int	nfs_setattrrpc __P((struct vnode *,struct vattr *,struct ucred *,struct proc *));
490 int	nfs_asyncio __P((struct buf *,struct ucred *));
491 int	nfs_doio __P((struct buf *,struct ucred *,struct proc *));
492 int	nfs_readlinkrpc __P((struct vnode *,struct uio *,struct ucred *));
493 int	nfs_sigintr __P((struct nfsmount *,struct nfsreq *r,struct proc *));
494 int	nfs_readdirplusrpc __P((struct vnode *,register struct uio *,struct ucred *));
495 int	nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
496 void	nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *));
497 void	nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **));
498 void	nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **));
499 int	nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,struct ucred *,struct nfssvc_sock *,struct mbuf *,int *,int));
500 int	nfsrv_access __P((struct vnode *,int,struct ucred *,int,struct proc *));
501 int	netaddr_match __P((int,union nethostaddr *,struct mbuf *));
502 int	nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *));
503 int	nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *));
504 int	nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struct mbuf *,struct mbuf **,caddr_t *,struct vnode **,struct proc *,int));
505 void	nfsm_adj __P((struct mbuf *,int,int));
506 int	nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *));
507 void	nfsrv_initcache __P((void));
508 int	nfs_rcvlock __P((struct nfsreq *));
509 int	nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T));
510 int	nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int));
511 int	nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *));
512 int	nfs_msg __P((struct proc *,char *,char *));
513 int	nfs_adv __P((struct mbuf **,caddr_t *,int,int));
514 int	nfsrv_getstream __P((struct nfssvc_sock *,int));
515 void	nfs_nhinit __P((void));
516 void	nfs_timer __P((void*));
517 u_long nfs_hash __P((nfsfh_t *,int));
518 int	nfssvc_iod __P((struct proc *));
519 int	nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *));
520 int	nfssvc_addsock __P((struct file *,struct mbuf *));
521 int	nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **));
522 int	nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **));
523 void	nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *));
524 int	mountnfs __P((struct nfs_args *,struct mount *,struct mbuf *,char *,char *,struct vnode **));
525 int	nfs_connect __P((struct nfsmount *,struct nfsreq *));
526 int	nfs_getattrcache __P((struct vnode *,struct vattr *));
527 int	nfsm_strtmbuf __P((struct mbuf **,char **,char *,long));
528 int	nfs_bioread __P((struct vnode *,struct uio *,int,struct ucred *));
529 int	nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *));
530 void	nfsrv_init __P((int));
531 void	nfs_clearcommit __P((struct mount *));
532 int	nfsrv_errmap __P((struct nfsrv_descript *, int));
533 void	nfsrvw_coalesce __P((struct nfsrv_descript *,struct nfsrv_descript *));
534 void	nfsrvw_sort __P((gid_t [],int));
535 void	nfsrv_setcred __P((struct ucred *,struct ucred *));
536 int	nfs_flush __P((struct vnode *,struct ucred *,int,struct proc *,int));
537 int	nfs_writebp __P((struct buf *,int));
538 #endif	/* KERNEL */
539 
540 #endif
541