nfsargs.h revision 36511
1230557Sjimharris/* 2230557Sjimharris * Copyright (c) 1989, 1993, 1995 3230557Sjimharris * The Regents of the University of California. All rights reserved. 4230557Sjimharris * 5230557Sjimharris * This code is derived from software contributed to Berkeley by 6230557Sjimharris * Rick Macklem at The University of Guelph. 7230557Sjimharris * 8230557Sjimharris * Redistribution and use in source and binary forms, with or without 9230557Sjimharris * modification, are permitted provided that the following conditions 10230557Sjimharris * are met: 11230557Sjimharris * 1. Redistributions of source code must retain the above copyright 12230557Sjimharris * notice, this list of conditions and the following disclaimer. 13230557Sjimharris * 2. Redistributions in binary form must reproduce the above copyright 14230557Sjimharris * notice, this list of conditions and the following disclaimer in the 15230557Sjimharris * documentation and/or other materials provided with the distribution. 16230557Sjimharris * 3. All advertising materials mentioning features or use of this software 17230557Sjimharris * must display the following acknowledgement: 18230557Sjimharris * This product includes software developed by the University of 19230557Sjimharris * California, Berkeley and its contributors. 20230557Sjimharris * 4. Neither the name of the University nor the names of its contributors 21230557Sjimharris * may be used to endorse or promote products derived from this software 22230557Sjimharris * without specific prior written permission. 23230557Sjimharris * 24230557Sjimharris * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25230557Sjimharris * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26230557Sjimharris * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27230557Sjimharris * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28230557Sjimharris * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29230557Sjimharris * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30230557Sjimharris * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31230557Sjimharris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32230557Sjimharris * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33230557Sjimharris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34230557Sjimharris * SUCH DAMAGE. 35230557Sjimharris * 36230557Sjimharris * @(#)nfs.h 8.4 (Berkeley) 5/1/95 37230557Sjimharris * $Id: nfs.h,v 1.37 1998/05/31 17:27:45 peter Exp $ 38230557Sjimharris */ 39230557Sjimharris 40230557Sjimharris#ifndef _NFS_NFS_H_ 41230557Sjimharris#define _NFS_NFS_H_ 42230557Sjimharris 43230557Sjimharris/* 44230557Sjimharris * Tunable constants for nfs 45230557Sjimharris */ 46230557Sjimharris 47230557Sjimharris#define NFS_MAXIOVEC 34 48230557Sjimharris#define NFS_TICKINTVL 5 /* Desired time for a tick (msec) */ 49230557Sjimharris#define NFS_HZ (hz / nfs_ticks) /* Ticks/sec */ 50230557Sjimharris#define NFS_TIMEO (1 * NFS_HZ) /* Default timeout = 1 second */ 51230557Sjimharris#define NFS_MINTIMEO (1 * NFS_HZ) /* Min timeout to use */ 52230557Sjimharris#define NFS_MAXTIMEO (60 * NFS_HZ) /* Max timeout to backoff to */ 53230557Sjimharris#define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/ 54230557Sjimharris#define NFS_MAXREXMIT 100 /* Stop counting after this many */ 55230557Sjimharris#define NFS_MAXWINDOW 1024 /* Max number of outstanding requests */ 56230557Sjimharris#define NFS_RETRANS 10 /* Num of retrans for soft mounts */ 57230557Sjimharris#define NFS_MAXGRPS 16 /* Max. size of groups list */ 58230557Sjimharris#ifndef NFS_MINATTRTIMO 59230557Sjimharris#define NFS_MINATTRTIMO 3 /* VREG attrib cache timeout in sec */ 60230557Sjimharris#endif 61230557Sjimharris#ifndef NFS_MAXATTRTIMO 62230557Sjimharris#define NFS_MAXATTRTIMO 60 63230557Sjimharris#endif 64230557Sjimharris#ifndef NFS_MINDIRATTRTIMO 65230557Sjimharris#define NFS_MINDIRATTRTIMO 30 /* VDIR attrib cache timeout in sec */ 66230557Sjimharris#endif 67230557Sjimharris#ifndef NFS_MAXDIRATTRTIMO 68230557Sjimharris#define NFS_MAXDIRATTRTIMO 60 69230557Sjimharris#endif 70230557Sjimharris#define NFS_WSIZE 8192 /* Def. write data size <= 8192 */ 71230557Sjimharris#define NFS_RSIZE 8192 /* Def. read data size <= 8192 */ 72230557Sjimharris#define NFS_READDIRSIZE 8192 /* Def. readdir size */ 73230557Sjimharris#define NFS_DEFRAHEAD 1 /* Def. read ahead # blocks */ 74230557Sjimharris#define NFS_MAXRAHEAD 4 /* Max. read ahead # blocks */ 75230557Sjimharris#define NFS_MAXUIDHASH 64 /* Max. # of hashed uid entries/mp */ 76230557Sjimharris#define NFS_MAXASYNCDAEMON 20 /* Max. number async_daemons runnable */ 77230557Sjimharris#define NFS_MAXGATHERDELAY 100 /* Max. write gather delay (msec) */ 78230557Sjimharris#ifndef NFS_GATHERDELAY 79230557Sjimharris#define NFS_GATHERDELAY 10 /* Default write gather delay (msec) */ 80230557Sjimharris#endif 81230557Sjimharris#define NFS_DIRBLKSIZ 4096 /* Must be a multiple of DIRBLKSIZ */ 82230557Sjimharris#ifdef KERNEL 83230557Sjimharris#define DIRBLKSIZ 512 /* XXX we used to use ufs's DIRBLKSIZ */ 84230557Sjimharris#endif 85230557Sjimharris 86230557Sjimharris/* 87230557Sjimharris * Oddballs 88230557Sjimharris */ 89230557Sjimharris#define NMOD(a) ((a) % nfs_asyncdaemons) 90230557Sjimharris#define NFS_CMPFH(n, f, s) \ 91230557Sjimharris ((n)->n_fhsize == (s) && !bcmp((caddr_t)(n)->n_fhp, (caddr_t)(f), (s))) 92230557Sjimharris#define NFS_ISV3(v) (VFSTONFS((v)->v_mount)->nm_flag & NFSMNT_NFSV3) 93230557Sjimharris#define NFS_SRVMAXDATA(n) \ 94230557Sjimharris (((n)->nd_flag & ND_NFSV3) ? (((n)->nd_nam2) ? \ 95230557Sjimharris NFS_MAXDGRAMDATA : NFS_MAXDATA) : NFS_V2MAXDATA) 96230557Sjimharris 97230557Sjimharris/* 98230557Sjimharris * XXX 99230557Sjimharris * The B_INVAFTERWRITE flag should be set to whatever is required by the 100230557Sjimharris * buffer cache code to say "Invalidate the block after it is written back". 101230557Sjimharris */ 102230557Sjimharris#define B_INVAFTERWRITE B_NOCACHE 103230557Sjimharris 104230557Sjimharris/* 105230557Sjimharris * The IO_METASYNC flag should be implemented for local file systems. 106230557Sjimharris * (Until then, it is nothin at all.) 107230557Sjimharris */ 108230557Sjimharris#ifndef IO_METASYNC 109230557Sjimharris#define IO_METASYNC 0 110230557Sjimharris#endif 111230557Sjimharris 112230557Sjimharris/* 113230557Sjimharris * Expected allocation sizes for major data structures. If the actual size 114230557Sjimharris * of the structure exceeds these sizes, then malloc() will be allocating 115230557Sjimharris * almost twice the memory required. This is used in nfs_init() to warn 116230557Sjimharris * the sysadmin that the size of a structure should be reduced. 117230557Sjimharris * (These sizes are always a power of 2. If the kernel malloc() changes 118230557Sjimharris * to one that does not allocate space in powers of 2 size, then this all 119230557Sjimharris * becomes bunk!) 120230557Sjimharris */ 121230557Sjimharris#define NFS_SVCALLOC 256 122230557Sjimharris#define NFS_UIDALLOC 128 123230557Sjimharris 124230557Sjimharris/* 125230557Sjimharris * Arguments to mount NFS 126230557Sjimharris */ 127230557Sjimharris#define NFS_ARGSVERSION 3 /* change when nfs_args changes */ 128230557Sjimharrisstruct nfs_args { 129230557Sjimharris int version; /* args structure version number */ 130230557Sjimharris struct sockaddr *addr; /* file server address */ 131230557Sjimharris int addrlen; /* length of address */ 132230557Sjimharris int sotype; /* Socket type */ 133230557Sjimharris int proto; /* and Protocol */ 134230557Sjimharris u_char *fh; /* File handle to be mounted */ 135230557Sjimharris int fhsize; /* Size, in bytes, of fh */ 136230557Sjimharris int flags; /* flags */ 137230557Sjimharris int wsize; /* write size in bytes */ 138230557Sjimharris int rsize; /* read size in bytes */ 139230557Sjimharris int readdirsize; /* readdir size in bytes */ 140230557Sjimharris int timeo; /* initial timeout in .1 secs */ 141230557Sjimharris int retrans; /* times to retry send */ 142230557Sjimharris int maxgrouplist; /* Max. size of group list */ 143230557Sjimharris int readahead; /* # of blocks to readahead */ 144230557Sjimharris int leaseterm; /* Term (sec) of lease */ 145230557Sjimharris int deadthresh; /* Retrans threshold */ 146230557Sjimharris char *hostname; /* server's name */ 147230557Sjimharris int acregmin; /* cache attrs for reg files min time */ 148230557Sjimharris int acregmax; /* cache attrs for reg files max time */ 149230557Sjimharris int acdirmin; /* cache attrs for dirs min time */ 150230557Sjimharris int acdirmax; /* cache attrs for dirs max time */ 151230557Sjimharris}; 152230557Sjimharris 153230557Sjimharris/* 154230557Sjimharris * NFS mount option flags 155230557Sjimharris */ 156230557Sjimharris#define NFSMNT_SOFT 0x00000001 /* soft mount (hard is default) */ 157230557Sjimharris#define NFSMNT_WSIZE 0x00000002 /* set write size */ 158230557Sjimharris#define NFSMNT_RSIZE 0x00000004 /* set read size */ 159230557Sjimharris#define NFSMNT_TIMEO 0x00000008 /* set initial timeout */ 160230557Sjimharris#define NFSMNT_RETRANS 0x00000010 /* set number of request retries */ 161230557Sjimharris#define NFSMNT_MAXGRPS 0x00000020 /* set maximum grouplist size */ 162230557Sjimharris#define NFSMNT_INT 0x00000040 /* allow interrupts on hard mount */ 163230557Sjimharris#define NFSMNT_NOCONN 0x00000080 /* Don't Connect the socket */ 164230557Sjimharris#define NFSMNT_NQNFS 0x00000100 /* Use Nqnfs protocol */ 165230557Sjimharris#define NFSMNT_NFSV3 0x00000200 /* Use NFS Version 3 protocol */ 166230557Sjimharris#define NFSMNT_KERB 0x00000400 /* Use Kerberos authentication */ 167230557Sjimharris#define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */ 168230557Sjimharris#define NFSMNT_LEASETERM 0x00001000 /* set lease term (nqnfs) */ 169230557Sjimharris#define NFSMNT_READAHEAD 0x00002000 /* set read ahead */ 170230557Sjimharris#define NFSMNT_DEADTHRESH 0x00004000 /* set dead server retry thresh */ 171230557Sjimharris#define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */ 172230557Sjimharris#define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */ 173230557Sjimharris#define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */ 174230557Sjimharris#define NFSMNT_ACREGMIN 0x00040000 175230557Sjimharris#define NFSMNT_ACREGMAX 0x00080000 176230557Sjimharris#define NFSMNT_ACDIRMIN 0x00100000 177230557Sjimharris#define NFSMNT_ACDIRMAX 0x00200000 178230557Sjimharris 179230557Sjimharris#define NFSSTA_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */ 180230557Sjimharris#define NFSSTA_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */ 181230557Sjimharris#define NFSSTA_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */ 182230557Sjimharris#define NFSSTA_MNTD 0x00200000 /* Mnt server for mnt point */ 183230557Sjimharris#define NFSSTA_DISMINPROG 0x00400000 /* Dismount in progress */ 184230557Sjimharris#define NFSSTA_DISMNT 0x00800000 /* Dismounted */ 185230557Sjimharris#define NFSSTA_SNDLOCK 0x01000000 /* Send socket lock */ 186230557Sjimharris#define NFSSTA_WANTSND 0x02000000 /* Want above */ 187230557Sjimharris#define NFSSTA_RCVLOCK 0x04000000 /* Rcv socket lock */ 188230557Sjimharris#define NFSSTA_WANTRCV 0x08000000 /* Want above */ 189230557Sjimharris#define NFSSTA_WAITAUTH 0x10000000 /* Wait for authentication */ 190230557Sjimharris#define NFSSTA_HASAUTH 0x20000000 /* Has authenticator */ 191230557Sjimharris#define NFSSTA_WANTAUTH 0x40000000 /* Wants an authenticator */ 192230557Sjimharris#define NFSSTA_AUTHERR 0x80000000 /* Authentication error */ 193230557Sjimharris 194230557Sjimharris/* 195230557Sjimharris * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs 196230557Sjimharris * should ever try and use it. 197230557Sjimharris */ 198230557Sjimharrisstruct nfsd_args { 199230557Sjimharris int sock; /* Socket to serve */ 200230557Sjimharris caddr_t name; /* Client addr for connection based sockets */ 201230557Sjimharris int namelen; /* Length of name */ 202230557Sjimharris}; 203230557Sjimharris 204230557Sjimharrisstruct nfsd_srvargs { 205230557Sjimharris struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */ 206230557Sjimharris uid_t nsd_uid; /* Effective uid mapped to cred */ 207230557Sjimharris u_long nsd_haddr; /* Ip address of client */ 208230557Sjimharris struct ucred nsd_cr; /* Cred. uid maps to */ 209230557Sjimharris int nsd_authlen; /* Length of auth string (ret) */ 210230557Sjimharris u_char *nsd_authstr; /* Auth string (ret) */ 211230557Sjimharris int nsd_verflen; /* and the verfier */ 212230557Sjimharris u_char *nsd_verfstr; 213230557Sjimharris struct timeval nsd_timestamp; /* timestamp from verifier */ 214230557Sjimharris u_long nsd_ttl; /* credential ttl (sec) */ 215230557Sjimharris NFSKERBKEY_T nsd_key; /* Session key */ 216230557Sjimharris}; 217230557Sjimharris 218230557Sjimharrisstruct nfsd_cargs { 219230557Sjimharris char *ncd_dirp; /* Mount dir path */ 220230557Sjimharris uid_t ncd_authuid; /* Effective uid */ 221230557Sjimharris int ncd_authtype; /* Type of authenticator */ 222230557Sjimharris int ncd_authlen; /* Length of authenticator string */ 223230557Sjimharris u_char *ncd_authstr; /* Authenticator string */ 224230557Sjimharris int ncd_verflen; /* and the verifier */ 225230557Sjimharris u_char *ncd_verfstr; 226230557Sjimharris NFSKERBKEY_T ncd_key; /* Session key */ 227230557Sjimharris}; 228230557Sjimharris 229230557Sjimharris/* 230230557Sjimharris * XXX to allow amd to include nfs.h without nfsproto.h 231230557Sjimharris */ 232230557Sjimharris#ifdef NFS_NPROCS 233230557Sjimharris/* 234230557Sjimharris * Stats structure 235230557Sjimharris */ 236230557Sjimharrisstruct nfsstats { 237230557Sjimharris int attrcache_hits; 238230557Sjimharris int attrcache_misses; 239230557Sjimharris int lookupcache_hits; 240230557Sjimharris int lookupcache_misses; 241230557Sjimharris int direofcache_hits; 242230557Sjimharris int direofcache_misses; 243230557Sjimharris int biocache_reads; 244230557Sjimharris int read_bios; 245230557Sjimharris int read_physios; 246230557Sjimharris int biocache_writes; 247230557Sjimharris int write_bios; 248230557Sjimharris int write_physios; 249230557Sjimharris int biocache_readlinks; 250230557Sjimharris int readlink_bios; 251230557Sjimharris int biocache_readdirs; 252230557Sjimharris int readdir_bios; 253230557Sjimharris int rpccnt[NFS_NPROCS]; 254230557Sjimharris int rpcretries; 255230557Sjimharris int srvrpccnt[NFS_NPROCS]; 256230557Sjimharris int srvrpc_errs; 257230557Sjimharris int srv_errs; 258230557Sjimharris int rpcrequests; 259230557Sjimharris int rpctimeouts; 260230557Sjimharris int rpcunexpected; 261230557Sjimharris int rpcinvalid; 262230557Sjimharris int srvcache_inproghits; 263230557Sjimharris int srvcache_idemdonehits; 264230557Sjimharris int srvcache_nonidemdonehits; 265230557Sjimharris int srvcache_misses; 266230557Sjimharris int srvnqnfs_leases; 267230557Sjimharris int srvnqnfs_maxleases; 268230557Sjimharris int srvnqnfs_getleases; 269230557Sjimharris int srvvop_writes; 270230557Sjimharris}; 271230557Sjimharris#endif 272230557Sjimharris 273230557Sjimharris/* 274230557Sjimharris * Flags for nfssvc() system call. 275230557Sjimharris */ 276230557Sjimharris#define NFSSVC_BIOD 0x002 277230557Sjimharris#define NFSSVC_NFSD 0x004 278230557Sjimharris#define NFSSVC_ADDSOCK 0x008 279230557Sjimharris#define NFSSVC_AUTHIN 0x010 280230557Sjimharris#define NFSSVC_GOTAUTH 0x040 281230557Sjimharris#define NFSSVC_AUTHINFAIL 0x080 282230557Sjimharris#define NFSSVC_MNTD 0x100 283230557Sjimharris 284230557Sjimharris/* 285230557Sjimharris * fs.nfs sysctl(3) identifiers 286230557Sjimharris */ 287230557Sjimharris#define NFS_NFSSTATS 1 /* struct: struct nfsstats */ 288230557Sjimharris#define NFS_NFSPRIVPORT 2 /* int: prohibit nfs to resvports */ 289230557Sjimharris 290230557Sjimharris#define FS_NFS_NAMES { \ 291230557Sjimharris { 0, 0 }, \ 292230557Sjimharris { "nfsstats", CTLTYPE_STRUCT }, \ 293230557Sjimharris { "nfsprivport", CTLTYPE_INT }, \ 294230557Sjimharris} 295230557Sjimharris 296230557Sjimharris#ifdef KERNEL 297230557Sjimharris 298230557Sjimharris#ifdef MALLOC_DECLARE 299230557SjimharrisMALLOC_DECLARE(M_NFSREQ); 300230557SjimharrisMALLOC_DECLARE(M_NFSDIROFF); 301230557SjimharrisMALLOC_DECLARE(M_NFSRVDESC); 302230557SjimharrisMALLOC_DECLARE(M_NFSUID); 303230557SjimharrisMALLOC_DECLARE(M_NQLEASE); 304230557SjimharrisMALLOC_DECLARE(M_NFSD); 305230557SjimharrisMALLOC_DECLARE(M_NFSBIGFH); 306230557SjimharrisMALLOC_DECLARE(M_NFSHASH); 307230557Sjimharris#endif 308230557Sjimharris 309230557Sjimharris#ifdef ZONE_INTERRUPT 310230557Sjimharrisextern vm_zone_t nfsmount_zone; 311230557Sjimharris#endif 312230557Sjimharris 313230557Sjimharrisstruct uio; struct buf; struct vattr; struct nameidata; /* XXX */ 314230557Sjimharris 315230557Sjimharris/* 316230557Sjimharris * The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts. 317230557Sjimharris * What should be in this set is open to debate, but I believe that since 318230557Sjimharris * I/O system calls on ufs are never interrupted by signals the set should 319230557Sjimharris * be minimal. My reasoning is that many current programs that use signals 320230557Sjimharris * such as SIGALRM will not expect file I/O system calls to be interrupted 321230557Sjimharris * by them and break. 322230557Sjimharris */ 323230557Sjimharris#define NFSINT_SIGMASK (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \ 324230557Sjimharris sigmask(SIGHUP)|sigmask(SIGQUIT)) 325230557Sjimharris 326230557Sjimharris/* 327230557Sjimharris * Socket errors ignored for connectionless sockets?? 328230557Sjimharris * For now, ignore them all 329230557Sjimharris */ 330230557Sjimharris#define NFSIGNORE_SOERROR(s, e) \ 331230557Sjimharris ((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \ 332230557Sjimharris ((s) & PR_CONNREQUIRED) == 0) 333230557Sjimharris 334230557Sjimharris/* 335230557Sjimharris * Nfs outstanding request list element 336230557Sjimharris */ 337230557Sjimharrisstruct nfsreq { 338230557Sjimharris TAILQ_ENTRY(nfsreq) r_chain; 339230557Sjimharris struct mbuf *r_mreq; 340230557Sjimharris struct mbuf *r_mrep; 341230557Sjimharris struct mbuf *r_md; 342230557Sjimharris caddr_t r_dpos; 343230557Sjimharris struct nfsmount *r_nmp; 344230557Sjimharris struct vnode *r_vp; 345230557Sjimharris u_long r_xid; 346230557Sjimharris int r_flags; /* flags on request, see below */ 347230557Sjimharris int r_retry; /* max retransmission count */ 348230557Sjimharris int r_rexmit; /* current retrans count */ 349230557Sjimharris int r_timer; /* tick counter on reply */ 350230557Sjimharris u_int32_t r_procnum; /* NFS procedure number */ 351230557Sjimharris int r_rtt; /* RTT for rpc */ 352230557Sjimharris struct proc *r_procp; /* Proc that did I/O system call */ 353230557Sjimharris}; 354230557Sjimharris 355230557Sjimharris/* 356230557Sjimharris * Queue head for nfsreq's 357230557Sjimharris */ 358230557Sjimharrisextern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq; 359230557Sjimharris 360230557Sjimharris/* Flag values for r_flags */ 361230557Sjimharris#define R_TIMING 0x01 /* timing request (in mntp) */ 362230557Sjimharris#define R_SENT 0x02 /* request has been sent */ 363230557Sjimharris#define R_SOFTTERM 0x04 /* soft mnt, too many retries */ 364230557Sjimharris#define R_INTR 0x08 /* intr mnt, signal pending */ 365230557Sjimharris#define R_SOCKERR 0x10 /* Fatal error on socket */ 366230557Sjimharris#define R_TPRINTFMSG 0x20 /* Did a tprintf msg. */ 367230557Sjimharris#define R_MUSTRESEND 0x40 /* Must resend request */ 368230557Sjimharris#define R_GETONEREP 0x80 /* Probe for one reply only */ 369230557Sjimharris 370230557Sjimharris/* 371230557Sjimharris * A list of nfssvc_sock structures is maintained with all the sockets 372230557Sjimharris * that require service by the nfsd. 373230557Sjimharris * The nfsuid structs hang off of the nfssvc_sock structs in both lru 374230557Sjimharris * and uid hash lists. 375230557Sjimharris */ 376230557Sjimharris#ifndef NFS_UIDHASHSIZ 377230557Sjimharris#define NFS_UIDHASHSIZ 29 /* Tune the size of nfssvc_sock with this */ 378230557Sjimharris#endif 379230557Sjimharris#define NUIDHASH(sock, uid) \ 380230557Sjimharris (&(sock)->ns_uidhashtbl[(uid) % NFS_UIDHASHSIZ]) 381230557Sjimharris#ifndef NFS_WDELAYHASHSIZ 382230557Sjimharris#define NFS_WDELAYHASHSIZ 16 /* and with this */ 383230557Sjimharris#endif 384230557Sjimharris#define NWDELAYHASH(sock, f) \ 385230557Sjimharris (&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ]) 386230557Sjimharris#ifndef NFS_MUIDHASHSIZ 387230557Sjimharris#define NFS_MUIDHASHSIZ 63 /* Tune the size of nfsmount with this */ 388230557Sjimharris#endif 389230557Sjimharris#define NMUIDHASH(nmp, uid) \ 390230557Sjimharris (&(nmp)->nm_uidhashtbl[(uid) % NFS_MUIDHASHSIZ]) 391230557Sjimharris#define NFSNOHASH(fhsum) \ 392230557Sjimharris (&nfsnodehashtbl[(fhsum) & nfsnodehash]) 393230557Sjimharris 394230557Sjimharris/* 395230557Sjimharris * Network address hash list element 396230557Sjimharris */ 397230557Sjimharrisunion nethostaddr { 398230557Sjimharris u_long had_inetaddr; 399230557Sjimharris struct sockaddr *had_nam; 400230557Sjimharris}; 401230557Sjimharris 402230557Sjimharrisstruct nfsuid { 403230557Sjimharris TAILQ_ENTRY(nfsuid) nu_lru; /* LRU chain */ 404230557Sjimharris LIST_ENTRY(nfsuid) nu_hash; /* Hash list */ 405230557Sjimharris int nu_flag; /* Flags */ 406230557Sjimharris union nethostaddr nu_haddr; /* Host addr. for dgram sockets */ 407230557Sjimharris struct ucred nu_cr; /* Cred uid mapped to */ 408230557Sjimharris int nu_expire; /* Expiry time (sec) */ 409230557Sjimharris struct timeval nu_timestamp; /* Kerb. timestamp */ 410230557Sjimharris u_long nu_nickname; /* Nickname on server */ 411230557Sjimharris NFSKERBKEY_T nu_key; /* and session key */ 412230557Sjimharris}; 413230557Sjimharris 414230557Sjimharris#define nu_inetaddr nu_haddr.had_inetaddr 415230557Sjimharris#define nu_nam nu_haddr.had_nam 416230557Sjimharris/* Bits for nu_flag */ 417230557Sjimharris#define NU_INETADDR 0x1 418230557Sjimharris#define NU_NAM 0x2 419230557Sjimharris#define NU_NETFAM(u) (((u)->nu_flag & NU_INETADDR) ? AF_INET : AF_ISO) 420230557Sjimharris 421230557Sjimharrisstruct nfsrv_rec { 422230557Sjimharris STAILQ_ENTRY(nfsrv_rec) nr_link; 423230557Sjimharris struct sockaddr *nr_address; 424230557Sjimharris struct mbuf *nr_packet; 425230557Sjimharris}; 426230557Sjimharris 427230557Sjimharrisstruct nfssvc_sock { 428230557Sjimharris TAILQ_ENTRY(nfssvc_sock) ns_chain; /* List of all nfssvc_sock's */ 429230557Sjimharris TAILQ_HEAD(, nfsuid) ns_uidlruhead; 430230557Sjimharris struct file *ns_fp; 431230557Sjimharris struct socket *ns_so; 432230557Sjimharris struct sockaddr *ns_nam; 433230557Sjimharris struct mbuf *ns_raw; 434230557Sjimharris struct mbuf *ns_rawend; 435230557Sjimharris STAILQ_HEAD(, nfsrv_rec) ns_rec; 436230557Sjimharris struct mbuf *ns_frag; 437230557Sjimharris int ns_flag; 438230557Sjimharris int ns_solock; 439230557Sjimharris int ns_cc; 440230557Sjimharris int ns_reclen; 441230557Sjimharris int ns_numuids; 442230557Sjimharris u_long ns_sref; 443230557Sjimharris LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */ 444230557Sjimharris LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ]; 445230557Sjimharris LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ]; 446230557Sjimharris}; 447230557Sjimharris 448230557Sjimharris/* Bits for "ns_flag" */ 449230557Sjimharris#define SLP_VALID 0x01 450230557Sjimharris#define SLP_DOREC 0x02 451230557Sjimharris#define SLP_NEEDQ 0x04 452230557Sjimharris#define SLP_DISCONN 0x08 453230557Sjimharris#define SLP_GETSTREAM 0x10 454230557Sjimharris#define SLP_LASTFRAG 0x20 455230557Sjimharris#define SLP_ALLFLAGS 0xff 456230557Sjimharris 457230557Sjimharrisextern TAILQ_HEAD(nfssvc_sockhead, nfssvc_sock) nfssvc_sockhead; 458230557Sjimharrisextern int nfssvc_sockhead_flag; 459230557Sjimharris#define SLP_INIT 0x01 460230557Sjimharris#define SLP_WANTINIT 0x02 461230557Sjimharris 462230557Sjimharris/* 463230557Sjimharris * One of these structures is allocated for each nfsd. 464230557Sjimharris */ 465230557Sjimharrisstruct nfsd { 466230557Sjimharris TAILQ_ENTRY(nfsd) nfsd_chain; /* List of all nfsd's */ 467230557Sjimharris int nfsd_flag; /* NFSD_ flags */ 468230557Sjimharris struct nfssvc_sock *nfsd_slp; /* Current socket */ 469230557Sjimharris int nfsd_authlen; /* Authenticator len */ 470230557Sjimharris u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */ 471230557Sjimharris int nfsd_verflen; /* and the Verifier */ 472230557Sjimharris u_char nfsd_verfstr[RPCVERF_MAXSIZ]; 473230557Sjimharris struct proc *nfsd_procp; /* Proc ptr */ 474230557Sjimharris struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */ 475230557Sjimharris}; 476230557Sjimharris 477230557Sjimharris/* Bits for "nfsd_flag" */ 478230557Sjimharris#define NFSD_WAITING 0x01 479230557Sjimharris#define NFSD_REQINPROG 0x02 480230557Sjimharris#define NFSD_NEEDAUTH 0x04 481230557Sjimharris#define NFSD_AUTHFAIL 0x08 482230557Sjimharris 483230557Sjimharris/* 484230557Sjimharris * This structure is used by the server for describing each request. 485230557Sjimharris * Some fields are used only when write request gathering is performed. 486230557Sjimharris */ 487230557Sjimharrisstruct nfsrv_descript { 488230557Sjimharris u_quad_t nd_time; /* Write deadline (usec) */ 489230557Sjimharris off_t nd_off; /* Start byte offset */ 490230557Sjimharris off_t nd_eoff; /* and end byte offset */ 491230557Sjimharris LIST_ENTRY(nfsrv_descript) nd_hash; /* Hash list */ 492230557Sjimharris LIST_ENTRY(nfsrv_descript) nd_tq; /* and timer list */ 493230557Sjimharris LIST_HEAD(,nfsrv_descript) nd_coalesce; /* coalesced writes */ 494230557Sjimharris struct mbuf *nd_mrep; /* Request mbuf list */ 495230557Sjimharris struct mbuf *nd_md; /* Current dissect mbuf */ 496230557Sjimharris struct mbuf *nd_mreq; /* Reply mbuf list */ 497230557Sjimharris struct sockaddr *nd_nam; /* and socket addr */ 498230557Sjimharris struct sockaddr *nd_nam2; /* return socket addr */ 499230557Sjimharris caddr_t nd_dpos; /* Current dissect pos */ 500230557Sjimharris u_int32_t nd_procnum; /* RPC # */ 501230557Sjimharris int nd_stable; /* storage type */ 502230557Sjimharris int nd_flag; /* nd_flag */ 503230557Sjimharris int nd_len; /* Length of this write */ 504230557Sjimharris int nd_repstat; /* Reply status */ 505230557Sjimharris u_long nd_retxid; /* Reply xid */ 506230557Sjimharris u_long nd_duration; /* Lease duration */ 507230557Sjimharris struct timeval nd_starttime; /* Time RPC initiated */ 508230557Sjimharris fhandle_t nd_fh; /* File handle */ 509230557Sjimharris struct ucred nd_cr; /* Credentials */ 510230557Sjimharris}; 511230557Sjimharris 512230557Sjimharris/* Bits for "nd_flag" */ 513230557Sjimharris#define ND_READ LEASE_READ 514230557Sjimharris#define ND_WRITE LEASE_WRITE 515230557Sjimharris#define ND_CHECK 0x04 516230557Sjimharris#define ND_LEASE (ND_READ | ND_WRITE | ND_CHECK) 517230557Sjimharris#define ND_NFSV3 0x08 518230557Sjimharris#define ND_NQNFS 0x10 519230557Sjimharris#define ND_KERBNICK 0x20 520230557Sjimharris#define ND_KERBFULL 0x40 521230557Sjimharris#define ND_KERBAUTH (ND_KERBNICK | ND_KERBFULL) 522230557Sjimharris 523230557Sjimharrisextern TAILQ_HEAD(nfsd_head, nfsd) nfsd_head; 524230557Sjimharrisextern int nfsd_head_flag; 525230557Sjimharris#define NFSD_CHECKSLP 0x01 526230557Sjimharris 527230557Sjimharris/* 528230557Sjimharris * These macros compare nfsrv_descript structures. 529230557Sjimharris */ 530230557Sjimharris#define NFSW_CONTIG(o, n) \ 531230557Sjimharris ((o)->nd_eoff >= (n)->nd_off && \ 532230557Sjimharris !bcmp((caddr_t)&(o)->nd_fh, (caddr_t)&(n)->nd_fh, NFSX_V3FH)) 533230557Sjimharris 534230557Sjimharris#define NFSW_SAMECRED(o, n) \ 535230557Sjimharris (((o)->nd_flag & ND_KERBAUTH) == ((n)->nd_flag & ND_KERBAUTH) && \ 536230557Sjimharris !bcmp((caddr_t)&(o)->nd_cr, (caddr_t)&(n)->nd_cr, \ 537230557Sjimharris sizeof (struct ucred))) 538230557Sjimharris 539230557Sjimharris/* 540230557Sjimharris * Defines for WebNFS 541230557Sjimharris */ 542230557Sjimharris 543230557Sjimharris#define WEBNFS_ESC_CHAR '%' 544230557Sjimharris#define WEBNFS_SPECCHAR_START 0x80 545230557Sjimharris 546230557Sjimharris#define WEBNFS_NATIVE_CHAR 0x80 547230557Sjimharris/* 548230557Sjimharris * .. 549230557Sjimharris * Possibly more here in the future. 550230557Sjimharris */ 551230557Sjimharris 552230557Sjimharris/* 553230557Sjimharris * Macro for converting escape characters in WebNFS pathnames. 554230557Sjimharris * Should really be in libkern. 555230557Sjimharris */ 556230557Sjimharris 557230557Sjimharris#define HEXTOC(c) \ 558230557Sjimharris ((c) >= 'a' ? ((c) - ('a' - 10)) : \ 559230557Sjimharris ((c) >= 'A' ? ((c) - ('A' - 10)) : ((c) - '0'))) 560230557Sjimharris#define HEXSTRTOI(p) \ 561230557Sjimharris ((HEXTOC(p[0]) << 4) + HEXTOC(p[1])) 562230557Sjimharris 563230557Sjimharris#ifdef NFS_DEBUG 564230557Sjimharris 565230557Sjimharrisextern int nfs_debug; 566230557Sjimharris#define NFS_DEBUG_ASYNCIO 1 /* asynchronous i/o */ 567230557Sjimharris#define NFS_DEBUG_WG 2 /* server write gathering */ 568230557Sjimharris#define NFS_DEBUG_RC 4 /* server request caching */ 569230557Sjimharris 570230557Sjimharris#define NFS_DPF(cat, args) \ 571230557Sjimharris do { \ 572230557Sjimharris if (nfs_debug & NFS_DEBUG_##cat) printf args; \ 573230557Sjimharris } while (0) 574230557Sjimharris 575230557Sjimharris#else 576230557Sjimharris 577230557Sjimharris#define NFS_DPF(cat, args) 578230557Sjimharris 579230557Sjimharris#endif 580230557Sjimharris 581230557Sjimharrisu_quad_t nfs_curusec __P((void)); 582230557Sjimharrisint nfs_init __P((struct vfsconf *vfsp)); 583230557Sjimharrisint nfs_reply __P((struct nfsreq *)); 584230557Sjimharrisint nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int)); 585230557Sjimharrisint nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *, 586230557Sjimharris struct nfsreq *)); 587230557Sjimharrisint nfs_rephead __P((int, struct nfsrv_descript *, struct nfssvc_sock *, 588230557Sjimharris int, int, u_quad_t *, struct mbuf **, struct mbuf **, 589230557Sjimharris caddr_t *)); 590230557Sjimharrisint nfs_sndlock __P((int *, int *, struct nfsreq *)); 591230557Sjimharrisvoid nfs_sndunlock __P((int *, int *)); 592230557Sjimharrisint nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *)); 593230557Sjimharrisint nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *, 594230557Sjimharris int)); 595230557Sjimharrisint nfs_readrpc __P((struct vnode *, struct uio *, struct ucred *)); 596230557Sjimharrisint nfs_writerpc __P((struct vnode *, struct uio *, struct ucred *, int *, 597230557Sjimharris int *)); 598230557Sjimharrisint nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *)); 599230557Sjimharrisint nfs_asyncio __P((struct buf *, struct ucred *)); 600230557Sjimharrisint nfs_doio __P((struct buf *, struct ucred *, struct proc *)); 601230557Sjimharrisint nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *)); 602230557Sjimharrisint nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *)); 603230557Sjimharrisint nfs_readdirplusrpc __P((struct vnode *, struct uio *, struct ucred *)); 604230557Sjimharrisint nfsm_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *)); 605230557Sjimharrisvoid nfsm_srvfattr __P((struct nfsrv_descript *, struct vattr *, 606230557Sjimharris struct nfs_fattr *)); 607230557Sjimharrisvoid nfsm_srvwcc __P((struct nfsrv_descript *, int, struct vattr *, int, 608230557Sjimharris struct vattr *, struct mbuf **, char **)); 609230557Sjimharrisvoid nfsm_srvpostopattr __P((struct nfsrv_descript *, int, struct vattr *, 610230557Sjimharris struct mbuf **, char **)); 611230557Sjimharrisint netaddr_match __P((int, union nethostaddr *, struct sockaddr *)); 612230557Sjimharrisint nfs_request __P((struct vnode *, struct mbuf *, int, struct proc *, 613230557Sjimharris struct ucred *, struct mbuf **, struct mbuf **, 614230557Sjimharris caddr_t *)); 615230557Sjimharrisint nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *, 616230557Sjimharris struct vattr *)); 617230557Sjimharrisint nfs_namei __P((struct nameidata *, fhandle_t *, int, 618230557Sjimharris struct nfssvc_sock *, struct sockaddr *, struct mbuf **, 619230557Sjimharris caddr_t *, struct vnode **, struct proc *, int, int)); 620230557Sjimharrisvoid nfsm_adj __P((struct mbuf *, int, int)); 621230557Sjimharrisint nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *)); 622230557Sjimharrisvoid nfsrv_initcache __P((void)); 623230557Sjimharrisint nfs_getauth __P((struct nfsmount *, struct nfsreq *, struct ucred *, 624230557Sjimharris char **, int *, char *, int *, NFSKERBKEY_T)); 625230557Sjimharrisint nfs_getnickauth __P((struct nfsmount *, struct ucred *, char **, 626230557Sjimharris int *, char *, int)); 627230557Sjimharrisint nfs_savenickauth __P((struct nfsmount *, struct ucred *, int, 628230557Sjimharris NFSKERBKEY_T, struct mbuf **, char **, 629230557Sjimharris struct mbuf *)); 630230557Sjimharrisint nfs_adv __P((struct mbuf **, caddr_t *, int, int)); 631230557Sjimharrisvoid nfs_nhinit __P((void)); 632230557Sjimharrisvoid nfs_timer __P((void*)); 633230557Sjimharrisu_long nfs_hash __P((nfsfh_t *, int)); 634230557Sjimharrisint nfsrv_dorec __P((struct nfssvc_sock *, struct nfsd *, 635230557Sjimharris struct nfsrv_descript **)); 636230557Sjimharrisint nfsrv_getcache __P((struct nfsrv_descript *, struct nfssvc_sock *, 637230557Sjimharris struct mbuf **)); 638230557Sjimharrisvoid nfsrv_updatecache __P((struct nfsrv_descript *, int, struct mbuf *)); 639230557Sjimharrisvoid nfsrv_cleancache __P((void)); 640230557Sjimharrisint nfs_connect __P((struct nfsmount *, struct nfsreq *)); 641230557Sjimharrisvoid nfs_disconnect __P((struct nfsmount *)); 642230557Sjimharrisint nfs_getattrcache __P((struct vnode *, struct vattr *)); 643230557Sjimharrisint nfsm_strtmbuf __P((struct mbuf **, char **, const char *, long)); 644230557Sjimharrisint nfs_bioread __P((struct vnode *, struct uio *, int, struct ucred *, 645230557Sjimharris int)); 646230557Sjimharrisint nfsm_uiotombuf __P((struct uio *, struct mbuf **, int, caddr_t *)); 647230557Sjimharrisvoid nfsrv_init __P((int)); 648230557Sjimharrisvoid nfs_clearcommit __P((struct mount *)); 649230557Sjimharrisint nfsrv_errmap __P((struct nfsrv_descript *, int)); 650230557Sjimharrisvoid nfsrvw_sort __P((gid_t *, int)); 651230557Sjimharrisvoid nfsrv_setcred __P((struct ucred *, struct ucred *)); 652230557Sjimharrisint nfs_writebp __P((struct buf *, int)); 653230557Sjimharrisint nfsrv_object_create __P((struct vnode *)); 654230557Sjimharrisvoid nfsrv_wakenfsd __P((struct nfssvc_sock *slp)); 655230557Sjimharrisint nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *, 656230557Sjimharris struct proc *, struct mbuf **)); 657230557Sjimharrisint nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *, 658230557Sjimharris struct proc *p)); 659230557Sjimharris 660230557Sjimharrisint nfsrv3_access __P((struct nfsrv_descript *nfsd, 661230557Sjimharris struct nfssvc_sock *slp, 662230557Sjimharris struct proc *procp, struct mbuf **mrq)); 663230557Sjimharrisint nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 664230557Sjimharris struct proc *procp, struct mbuf **mrq)); 665230557Sjimharrisint nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 666230557Sjimharris struct proc *procp, struct mbuf **mrq)); 667230557Sjimharrisint nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *, 668230557Sjimharris struct nfssvc_sock *, struct sockaddr *, int *, 669230557Sjimharris int, int)); 670230557Sjimharrisint nfsrv_setpublicfs __P((struct mount *, struct netexport *, 671230557Sjimharris struct export_args *)); 672230557Sjimharrisint nfs_ispublicfh __P((fhandle_t *)); 673230557Sjimharrisint nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 674230557Sjimharris struct proc *procp, struct mbuf **mrq)); 675230557Sjimharrisint nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 676230557Sjimharris struct proc *procp, struct mbuf **mrq)); 677230557Sjimharrisint nfsrv_link __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 678230557Sjimharris struct proc *procp, struct mbuf **mrq)); 679230557Sjimharrisint nfsrv_lookup __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 680230557Sjimharris struct proc *procp, struct mbuf **mrq)); 681230557Sjimharrisint nfsrv_mkdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 682230557Sjimharris struct proc *procp, struct mbuf **mrq)); 683230557Sjimharrisint nfsrv_mknod __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 684230557Sjimharris struct proc *procp, struct mbuf **mrq)); 685230557Sjimharrisint nfsrv_noop __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 686230557Sjimharris struct proc *procp, struct mbuf **mrq)); 687230557Sjimharrisint nfsrv_null __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 688230557Sjimharris struct proc *procp, struct mbuf **mrq)); 689230557Sjimharrisint nfsrv_pathconf __P((struct nfsrv_descript *nfsd, 690230557Sjimharris struct nfssvc_sock *slp, struct proc *procp, 691230557Sjimharris struct mbuf **mrq)); 692230557Sjimharrisint nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 693230557Sjimharris struct proc *procp, struct mbuf **mrq)); 694230557Sjimharrisint nfsrv_readdir __P((struct nfsrv_descript *nfsd, 695230557Sjimharris struct nfssvc_sock *slp, 696230557Sjimharris struct proc *procp, struct mbuf **mrq)); 697230557Sjimharrisint nfsrv_readdirplus __P((struct nfsrv_descript *nfsd, 698230557Sjimharris struct nfssvc_sock *slp, struct proc *procp, 699230557Sjimharris struct mbuf **mrq)); 700230557Sjimharrisint nfsrv_readlink __P((struct nfsrv_descript *nfsd, 701230557Sjimharris struct nfssvc_sock *slp, struct proc *procp, 702230557Sjimharris struct mbuf **mrq)); 703230557Sjimharrisint nfsrv_remove __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 704230557Sjimharris struct proc *procp, struct mbuf **mrq)); 705230557Sjimharrisint nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 706230557Sjimharris struct proc *procp, struct mbuf **mrq)); 707230557Sjimharrisint nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 708230557Sjimharris struct proc *procp, struct mbuf **mrq)); 709230557Sjimharrisint nfsrv_setattr __P((struct nfsrv_descript *nfsd, 710230557Sjimharris struct nfssvc_sock *slp, 711230557Sjimharris struct proc *procp, struct mbuf **mrq)); 712230557Sjimharrisint nfsrv_statfs __P((struct nfsrv_descript *nfsd, 713230557Sjimharris struct nfssvc_sock *slp, 714230557Sjimharris struct proc *procp, struct mbuf **mrq)); 715230557Sjimharrisint nfsrv_symlink __P((struct nfsrv_descript *nfsd, 716230557Sjimharris struct nfssvc_sock *slp, 717230557Sjimharris struct proc *procp, struct mbuf **mrq)); 718230557Sjimharrisint nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, 719230557Sjimharris struct proc *procp, struct mbuf **mrq)); 720230557Sjimharrisvoid nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag)); 721230557Sjimharrisvoid nfsrv_slpderef __P((struct nfssvc_sock *slp)); 722230557Sjimharris#endif /* KERNEL */ 723230557Sjimharris 724230557Sjimharris#endif 725230557Sjimharris