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 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. All advertising materials mentioning features or use of this software 17 * must display the following acknowledgement: 18 * This product includes software developed by the University of 19 * California, Berkeley and its contributors. 20 * 4. Neither the name of the University nor the names of its contributors 21 * may be used to endorse or promote products derived from this software 22 * without specific prior written permission. 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)nfs.h 8.1 (Berkeley) 6/10/93 37 * $Id: nfs.h,v 1.10 1995/06/27 11:06:33 dfr Exp $ 38 */ 39 40 #ifndef _NFS_NFS_H_ 41 #define _NFS_NFS_H_ 42 43 /* 44 * Tunable constants for nfs 45 */ 46 47 #define NFS_MAXIOVEC 34 48 #define NFS_TICKINTVL 5 /* Desired time for a tick (msec) */ 49 #define NFS_HZ (hz / nfs_ticks) /* Ticks/sec */ 50 #define NFS_TIMEO (1 * NFS_HZ) /* Default timeout = 1 second */ 51 #define NFS_MINTIMEO (1 * NFS_HZ) /* Min timeout to use */ 52 #define NFS_MAXTIMEO (60 * NFS_HZ) /* Max timeout to backoff to */ 53 #define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/ 54 #define NFS_MAXREXMIT 100 /* Stop counting after this many */ 55 #define NFS_MAXWINDOW 1024 /* Max number of outstanding requests */ 56 #define NFS_RETRANS 10 /* Num of retrans for soft mounts */ 57 #define NFS_MAXGRPS 16 /* Max. size of groups list */ 58 #ifndef NFS_MINATTRTIMO 59 #define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */ 60 #endif 61 #ifndef NFS_MAXATTRTIMO 62 #define NFS_MAXATTRTIMO 60 63 #endif 64 #define NFS_WSIZE 8192 /* Def. write data size <= 8192 */ 65 #define NFS_RSIZE 8192 /* Def. read data size <= 8192 */ 66 #define NFS_READDIRSIZE 8192 /* Def. readdir size */ 67 #define NFS_DEFRAHEAD 1 /* Def. read ahead # blocks */ 68 #define NFS_MAXRAHEAD 4 /* Max. read ahead # blocks */ 69 #define NFS_MAXUIDHASH 64 /* Max. # of hashed uid entries/mp */ 70 #define NFS_MAXASYNCDAEMON 20 /* Max. number async_daemons runable */ 71 #define NFS_MAXGATHERDELAY 100 /* Max. write gather delay (msec) */ 72 #ifndef NFS_GATHERDELAY 73 #define NFS_GATHERDELAY 10 /* Default write gather delay (msec) */ 74 #endif 75 #define NFS_DIRBLKSIZ 4096 /* Must be a multiple of DIRBLKSIZ */ 76 77 /* 78 * Oddballs 79 */ 80 #define NMOD(a) ((a) % nfs_asyncdaemons) 81 #define NFS_CMPFH(n, f, s) \ 82 ((n)->n_fhsize == (s) && !bcmp((caddr_t)(n)->n_fhp, (caddr_t)(f), (s))) 83 #define NFS_ISV3(v) (VFSTONFS((v)->v_mount)->nm_flag & NFSMNT_NFSV3) 84 #define NFS_SRVMAXDATA(n) \ 85 (((n)->nd_flag & ND_NFSV3) ? (((n)->nd_nam2) ? \ 86 NFS_MAXDGRAMDATA : NFS_MAXDATA) : NFS_V2MAXDATA) 87 88 /* 89 * XXX 90 * sys/buf.h should be editted to change B_APPENDWRITE --> B_NEEDCOMMIT, but 91 * until then... 92 * Same goes for sys/malloc.h, which needs M_NFSDIROFF, 93 * M_NFSRVDESC and M_NFSBIGFH added. 94 * The VA_EXCLUSIVE flag should be added for va_vaflags and set for an 95 * exclusive create. 96 * The B_INVAFTERWRITE flag should be set to whatever is required by the 97 * buffer cache code to say "Invalidate the block after it is written back". 98 */ 99 #ifndef B_NEEDCOMMIT 100 #define B_NEEDCOMMIT B_APPENDWRITE 101 #endif 102 #ifndef M_NFSRVDESC 103 #define M_NFSRVDESC M_TEMP 104 #endif 105 #ifndef M_NFSDIROFF 106 #define M_NFSDIROFF M_TEMP 107 #endif 108 #ifndef M_NFSBIGFH 109 #define M_NFSBIGFH M_TEMP 110 #endif 111 #ifndef VA_EXCLUSIVE 112 #define VA_EXCLUSIVE 0 113 #endif 114 #ifdef __FreeBSD__ 115 #define B_INVAFTERWRITE B_NOCACHE 116 #else 117 #define B_INVAFTERWRITE B_INVAL 118 #endif 119 120 /* 121 * These ifdefs try to handle the differences between the various 4.4BSD-Lite 122 * based vfs interfaces. 123 * btw: NetBSD-current does have a VOP_LEASDE(), but I don't know how to 124 * differentiate between NetBSD-1.0 and NetBSD-current, so.. 125 * I also don't know about BSDi's 2.0 release. 126 */ 127 #if !defined(HAS_VOPLEASE) && !defined(__FreeBSD__) && !defined(__NetBSD__) 128 #define HAS_VOPLEASE 1 129 #endif 130 #if !defined(HAS_VOPREVOKE) && !defined(__FreeBSD__) && !defined(__NetBSD__) 131 #define HAS_VOPREVOKE 1 132 #endif 133 134 /* 135 * The IO_METASYNC flag should be implemented for local file systems. 136 * (Until then, it is nothin at all.) 137 */ 138 #ifndef IO_METASYNC 139 #define IO_METASYNC 0 140 #endif 141 142 /* 143 * Set the attribute timeout based on how recently the file has been modified. 144 */ 145 #define NFS_ATTRTIMEO(np) \ 146 ((((np)->n_flag & NMODIFIED) || \ 147 (time.tv_sec - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \ 148 ((time.tv_sec - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \ 149 (time.tv_sec - (np)->n_mtime) / 10)) 150 151 /* 152 * Expected allocation sizes for major data structures. If the actual size 153 * of the structure exceeds these sizes, then malloc() will be allocating 154 * almost twice the memory required. This is used in nfs_init() to warn 155 * the sysadmin that the size of a structure should be reduced. 156 * (These sizes are always a power of 2. If the kernel malloc() changes 157 * to one that does not allocate space in powers of 2 size, then this all 158 * becomes bunk!) 159 */ 160 #define NFS_NODEALLOC 256 161 #define NFS_MNTALLOC 512 162 #define NFS_SVCALLOC 256 163 #define NFS_UIDALLOC 128 164 165 /* 166 * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs 167 * should ever try and use it. 168 */ 169 struct nfsd_args { 170 int sock; /* Socket to serve */ 171 caddr_t name; /* Client address for connection based sockets */ 172 int namelen; /* Length of name */ 173 }; 174 175 struct nfsd_srvargs { 176 struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */ 177 uid_t nsd_uid; /* Effective uid mapped to cred */ 178 u_long nsd_haddr; /* Ip address of client */ 179 struct ucred nsd_cr; /* Cred. uid maps to */ 180 int nsd_authlen; /* Length of auth string (ret) */ 181 u_char *nsd_authstr; /* Auth string (ret) */ 182 int nsd_verflen; /* and the verfier */ 183 u_char *nsd_verfstr; 184 struct timeval nsd_timestamp; /* timestamp from verifier */ 185 u_long nsd_ttl; /* credential ttl (sec) */ 186 NFSKERBKEY_T nsd_key; /* Session key */ 187 }; 188 189 struct nfsd_cargs { 190 char *ncd_dirp; /* Mount dir path */ 191 uid_t ncd_authuid; /* Effective uid */ 192 int ncd_authtype; /* Type of authenticator */ 193 int ncd_authlen; /* Length of authenticator string */ 194 u_char *ncd_authstr; /* Authenticator string */ 195 int ncd_verflen; /* and the verifier */ 196 u_char *ncd_verfstr; 197 NFSKERBKEY_T ncd_key; /* Session key */ 198 }; 199 200 /* 201 * Stats structure 202 */ 203 struct nfsstats { 204 int attrcache_hits; 205 int attrcache_misses; 206 int lookupcache_hits; 207 int lookupcache_misses; 208 int direofcache_hits; 209 int direofcache_misses; 210 int biocache_reads; 211 int read_bios; 212 int read_physios; 213 int biocache_writes; 214 int write_bios; 215 int write_physios; 216 int biocache_readlinks; 217 int readlink_bios; 218 int biocache_readdirs; 219 int readdir_bios; 220 int rpccnt[NFS_NPROCS]; 221 int rpcretries; 222 int srvrpccnt[NFS_NPROCS]; 223 int srvrpc_errs; 224 int srv_errs; 225 int rpcrequests; 226 int rpctimeouts; 227 int rpcunexpected; 228 int rpcinvalid; 229 int srvcache_inproghits; 230 int srvcache_idemdonehits; 231 int srvcache_nonidemdonehits; 232 int srvcache_misses; 233 int srvnqnfs_leases; 234 int srvnqnfs_maxleases; 235 int srvnqnfs_getleases; 236 int srvvop_writes; 237 }; 238 239 /* 240 * Flags for nfssvc() system call. 241 */ 242 #define NFSSVC_BIOD 0x002 243 #define NFSSVC_NFSD 0x004 244 #define NFSSVC_ADDSOCK 0x008 245 #define NFSSVC_AUTHIN 0x010 246 #define NFSSVC_GOTAUTH 0x040 247 #define NFSSVC_AUTHINFAIL 0x080 248 #define NFSSVC_MNTD 0x100 249 250 /* 251 * fs.nfs sysctl(3) identifiers 252 */ 253 #define NFS_NFSSTATS 1 /* struct: struct nfsstats */ 254 255 #define FS_NFS_NAMES { \ 256 { 0, 0 }, \ 257 { "nfsstats", CTLTYPE_STRUCT }, \ 258 } 259 260 /* 261 * The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts. 262 * What should be in this set is open to debate, but I believe that since 263 * I/O system calls on ufs are never interrupted by signals the set should 264 * be minimal. My reasoning is that many current programs that use signals 265 * such as SIGALRM will not expect file I/O system calls to be interrupted 266 * by them and break. 267 */ 268 #if defined(KERNEL) || defined(_KERNEL) 269 270 struct uio; struct buf; struct vattr; struct nameidata; /* XXX */ 271 272 #define NFSINT_SIGMASK (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \ 273 sigmask(SIGHUP)|sigmask(SIGQUIT)) 274 275 /* 276 * Socket errors ignored for connectionless sockets?? 277 * For now, ignore them all 278 */ 279 #define NFSIGNORE_SOERROR(s, e) \ 280 ((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \ 281 ((s) & PR_CONNREQUIRED) == 0) 282 283 /* 284 * Nfs outstanding request list element 285 */ 286 struct nfsreq { 287 TAILQ_ENTRY(nfsreq) r_chain; 288 struct mbuf *r_mreq; 289 struct mbuf *r_mrep; 290 struct mbuf *r_md; 291 caddr_t r_dpos; 292 struct nfsmount *r_nmp; 293 struct vnode *r_vp; 294 u_long r_xid; 295 int r_flags; /* flags on request, see below */ 296 int r_retry; /* max retransmission count */ 297 int r_rexmit; /* current retrans count */ 298 int r_timer; /* tick counter on reply */ 299 int r_procnum; /* NFS procedure number */ 300 int r_rtt; /* RTT for rpc */ 301 struct proc *r_procp; /* Proc that did I/O system call */ 302 }; 303 304 /* 305 * Queue head for nfsreq's 306 */ 307 extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq; 308 309 /* Flag values for r_flags */ 310 #define R_TIMING 0x01 /* timing request (in mntp) */ 311 #define R_SENT 0x02 /* request has been sent */ 312 #define R_SOFTTERM 0x04 /* soft mnt, too many retries */ 313 #define R_INTR 0x08 /* intr mnt, signal pending */ 314 #define R_SOCKERR 0x10 /* Fatal error on socket */ 315 #define R_TPRINTFMSG 0x20 /* Did a tprintf msg. */ 316 #define R_MUSTRESEND 0x40 /* Must resend request */ 317 #define R_GETONEREP 0x80 /* Probe for one reply only */ 318 319 /* 320 * A list of nfssvc_sock structures is maintained with all the sockets 321 * that require service by the nfsd. 322 * The nfsuid structs hang off of the nfssvc_sock structs in both lru 323 * and uid hash lists. 324 */ 325 #ifndef NFS_UIDHASHSIZ 326 #define NFS_UIDHASHSIZ 29 /* Tune the size of nfssvc_sock with this */ 327 #endif 328 #define NUIDHASH(sock, uid) \ 329 (&(sock)->ns_uidhashtbl[(uid) % NFS_UIDHASHSIZ]) 330 #ifndef NFS_WDELAYHASHSIZ 331 #define NFS_WDELAYHASHSIZ 16 /* and with this */ 332 #endif 333 #define NWDELAYHASH(sock, f) \ 334 (&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ]) 335 #ifndef NFS_MUIDHASHSIZ 336 #define NFS_MUIDHASHSIZ 67 /* Tune the size of nfsmount with this */ 337 #endif 338 #define NMUIDHASH(nmp, uid) \ 339 (&(nmp)->nm_uidhashtbl[(uid) % NFS_MUIDHASHSIZ]) 340 #define NFSNOHASH(fhsum) \ 341 (&nfsnodehashtbl[(fhsum) & nfsnodehash]) 342 343 /* 344 * Network address hash list element 345 */ 346 union nethostaddr { 347 u_long had_inetaddr; 348 struct mbuf *had_nam; 349 }; 350 351 struct nfsuid { 352 TAILQ_ENTRY(nfsuid) nu_lru; /* LRU chain */ 353 LIST_ENTRY(nfsuid) nu_hash; /* Hash list */ 354 int nu_flag; /* Flags */ 355 union nethostaddr nu_haddr; /* Host addr. for dgram sockets */ 356 struct ucred nu_cr; /* Cred uid mapped to */ 357 int nu_expire; /* Expiry time (sec) */ 358 struct timeval nu_timestamp; /* Kerb. timestamp */ 359 u_long nu_nickname; /* Nickname on server */ 360 NFSKERBKEY_T nu_key; /* and session key */ 361 }; 362 363 #define nu_inetaddr nu_haddr.had_inetaddr 364 #define nu_nam nu_haddr.had_nam 365 /* Bits for nu_flag */ 366 #define NU_INETADDR 0x1 367 #define NU_NAM 0x2 368 #define NU_NETFAM(u) (((u)->nu_flag & NU_INETADDR) ? AF_INET : AF_ISO) 369 370 struct nfssvc_sock { 371 TAILQ_ENTRY(nfssvc_sock) ns_chain; /* List of all nfssvc_sock's */ 372 TAILQ_HEAD(, nfsuid) ns_uidlruhead; 373 struct file *ns_fp; 374 struct socket *ns_so; 375 struct mbuf *ns_nam; 376 struct mbuf *ns_raw; 377 struct mbuf *ns_rawend; 378 struct mbuf *ns_rec; 379 struct mbuf *ns_recend; 380 struct mbuf *ns_frag; 381 int ns_flag; 382 int ns_solock; 383 int ns_cc; 384 int ns_reclen; 385 int ns_numuids; 386 u_long ns_sref; 387 LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */ 388 LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ]; 389 LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ]; 390 }; 391 392 /* Bits for "ns_flag" */ 393 #define SLP_VALID 0x01 394 #define SLP_DOREC 0x02 395 #define SLP_NEEDQ 0x04 396 #define SLP_DISCONN 0x08 397 #define SLP_GETSTREAM 0x10 398 #define SLP_LASTFRAG 0x20 399 #define SLP_ALLFLAGS 0xff 400 401 extern TAILQ_HEAD(nfssvc_sockhead, nfssvc_sock) nfssvc_sockhead; 402 extern int nfssvc_sockhead_flag; 403 #define SLP_INIT 0x01 404 #define SLP_WANTINIT 0x02 405 406 /* 407 * One of these structures is allocated for each nfsd. 408 */ 409 struct nfsd { 410 TAILQ_ENTRY(nfsd) nfsd_chain; /* List of all nfsd's */ 411 int nfsd_flag; /* NFSD_ flags */ 412 struct nfssvc_sock *nfsd_slp; /* Current socket */ 413 int nfsd_authlen; /* Authenticator len */ 414 u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */ 415 int nfsd_verflen; /* and the Verifier */ 416 u_char nfsd_verfstr[RPCVERF_MAXSIZ]; 417 struct proc *nfsd_procp; /* Proc ptr */ 418 struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */ 419 }; 420 421 /* Bits for "nfsd_flag" */ 422 #define NFSD_WAITING 0x01 423 #define NFSD_REQINPROG 0x02 424 #define NFSD_NEEDAUTH 0x04 425 #define NFSD_AUTHFAIL 0x08 426 427 /* 428 * This structure is used by the server for describing each request. 429 * Some fields are used only when write request gathering is performed. 430 */ 431 struct nfsrv_descript { 432 u_quad_t nd_time; /* Write deadline (usec) */ 433 off_t nd_off; /* Start byte offset */ 434 off_t nd_eoff; /* and end byte offset */ 435 LIST_ENTRY(nfsrv_descript) nd_hash; /* Hash list */ 436 LIST_ENTRY(nfsrv_descript) nd_tq; /* and timer list */ 437 LIST_HEAD(,nfsrv_descript) nd_coalesce; /* coalesced writes */ 438 struct mbuf *nd_mrep; /* Request mbuf list */ 439 struct mbuf *nd_md; /* Current dissect mbuf */ 440 struct mbuf *nd_mreq; /* Reply mbuf list */ 441 struct mbuf *nd_nam; /* and socket addr */ 442 struct mbuf *nd_nam2; /* return socket addr */ 443 caddr_t nd_dpos; /* Current dissect pos */ 444 int nd_procnum; /* RPC # */ 445 int nd_stable; /* storage type */ 446 int nd_flag; /* nd_flag */ 447 int nd_len; /* Length of this write */ 448 int nd_repstat; /* Reply status */ 449 u_long nd_retxid; /* Reply xid */ 450 u_long nd_duration; /* Lease duration */ 451 struct timeval nd_starttime; /* Time RPC initiated */ 452 fhandle_t nd_fh; /* File handle */ 453 struct ucred nd_cr; /* Credentials */ 454 }; 455 456 /* Bits for "nd_flag" */ 457 #define ND_READ LEASE_READ 458 #define ND_WRITE LEASE_WRITE 459 #define ND_CHECK 0x04 460 #define ND_LEASE (ND_READ | ND_WRITE | ND_CHECK) 461 #define ND_NFSV3 0x08 462 #define ND_NQNFS 0x10 463 #define ND_KERBNICK 0x20 464 #define ND_KERBFULL 0x40 465 #define ND_KERBAUTH (ND_KERBNICK | ND_KERBFULL) 466 467 extern TAILQ_HEAD(nfsd_head, nfsd) nfsd_head; 468 extern int nfsd_head_flag; 469 #define NFSD_CHECKSLP 0x01 470 471 /* 472 * These macros compare nfsrv_descript structures. 473 */ 474 #define NFSW_CONTIG(o, n) \ 475 ((o)->nd_eoff >= (n)->nd_off && \ 476 !bcmp((caddr_t)&(o)->nd_fh, (caddr_t)&(n)->nd_fh, NFSX_V3FH)) 477 478 #define NFSW_SAMECRED(o, n) \ 479 (((o)->nd_flag & ND_KERBAUTH) == ((n)->nd_flag & ND_KERBAUTH) && \ 480 !bcmp((caddr_t)&(o)->nd_cr, (caddr_t)&(n)->nd_cr, \ 481 sizeof (struct ucred))) 482 483 int nfs_reply __P((struct nfsreq *)); 484 int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int)); 485 int nfs_send __P((struct socket *,struct mbuf *,struct mbuf *,struct nfsreq *)); 486 int nfs_rephead __P((int,struct nfsrv_descript *,struct nfssvc_sock *,int,int,u_quad_t *,struct mbuf **,struct mbuf **,caddr_t *)); 487 int nfs_sndlock __P((int *,struct nfsreq *)); 488 int nfs_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *)); 489 int nfs_vinvalbuf __P((struct vnode *,int,struct ucred *,struct proc *,int)); 490 int nfs_readrpc __P((struct vnode *,struct uio *,struct ucred *)); 491 int nfs_writerpc __P((struct vnode *,struct uio *,struct ucred *,int *,int *)); 492 int nfs_readdirrpc __P((register struct vnode *,struct uio *,struct ucred *)); 493 int nfs_setattrrpc __P((struct vnode *,struct vattr *,struct ucred *,struct proc *)); 494 int nfs_asyncio __P((struct buf *,struct ucred *)); 495 int nfs_doio __P((struct buf *,struct ucred *,struct proc *)); 496 int nfs_readlinkrpc __P((struct vnode *,struct uio *,struct ucred *)); 497 int nfs_sigintr __P((struct nfsmount *,struct nfsreq *r,struct proc *)); 498 int nfs_readdirplusrpc __P((struct vnode *,register struct uio *,struct ucred *)); 499 int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *)); 500 void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *)); 501 void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **)); 502 void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **)); 503 int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,struct ucred *,struct nfssvc_sock *,struct mbuf *,int *,int)); 504 int nfsrv_access __P((struct vnode *,int,struct ucred *,int,struct proc *)); 505 int netaddr_match __P((int,union nethostaddr *,struct mbuf *)); 506 int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *)); 507 int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *)); 508 int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struct mbuf *,struct mbuf **,caddr_t *,struct vnode **,struct proc *,int)); 509 void nfsm_adj __P((struct mbuf *,int,int)); 510 int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *)); 511 void nfsrv_initcache __P((void)); 512 int nfs_rcvlock __P((struct nfsreq *)); 513 int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T)); 514 int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int)); 515 int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *)); 516 int nfs_msg __P((struct proc *,char *,char *)); 517 int nfs_adv __P((struct mbuf **,caddr_t *,int,int)); 518 int nfsrv_getstream __P((struct nfssvc_sock *,int)); 519 void nfs_nhinit __P((void)); 520 void nfs_timer __P((void*)); 521 u_long nfs_hash __P((nfsfh_t *,int)); 522 int nfssvc_iod __P((struct proc *)); 523 int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); 524 int nfssvc_addsock __P((struct file *,struct mbuf *)); 525 int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **)); 526 int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **)); 527 void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *)); 528 int mountnfs __P((struct nfs_args *,struct mount *,struct mbuf *,char *,char *,struct vnode **)); 529 int nfs_connect __P((struct nfsmount *,struct nfsreq *)); 530 int nfs_getattrcache __P((struct vnode *,struct vattr *)); 531 int nfsm_strtmbuf __P((struct mbuf **,char **,char *,long)); 532 int nfs_bioread __P((struct vnode *,struct uio *,int,struct ucred *)); 533 int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *)); 534 void nfsrv_init __P((int)); 535 void nfs_clearcommit __P((struct mount *)); 536 int nfsrv_errmap __P((struct nfsrv_descript *, int)); 537 void nfsrvw_coalesce __P((struct nfsrv_descript *,struct nfsrv_descript *)); 538 void nfsrvw_sort __P((gid_t [],int)); 539 void nfsrv_setcred __P((struct ucred *,struct ucred *)); 540 int nfs_flush __P((struct vnode *,struct ucred *,int,struct proc *,int)); 541 int nfs_writebp __P((struct buf *,int)); 542 int nfsrv_vput __P(( struct vnode * )); 543 int nfsrv_vrele __P(( struct vnode * )); 544 int nfsrv_vmio __P(( struct vnode * )); 545 int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *, 546 struct proc *, struct mbuf **)); 547 int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *, 548 struct proc *p)); 549 550 #endif /* KERNEL */ 551 552 #endif 553