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
| 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
|
40/* 41 * Tunable constants for nfs 42 */ 43 44#define NFS_MAXIOVEC 34 45#define NFS_HZ 25 /* Ticks per second for NFS timeouts */ 46#define NFS_TIMEO (1*NFS_HZ) /* Default timeout = 1 second */ 47#define NFS_MINTIMEO (1*NFS_HZ) /* Min timeout to use */ 48#define NFS_MAXTIMEO (60*NFS_HZ) /* Max timeout to backoff to */ 49#define NFS_MINIDEMTIMEO (5*NFS_HZ) /* Min timeout for non-idempotent ops*/ 50#define NFS_MAXREXMIT 100 /* Stop counting after this many */ 51#define NFS_MAXWINDOW 1024 /* Max number of outstanding requests */ 52#define NFS_RETRANS 10 /* Num of retrans for soft mounts */ 53#define NFS_MAXGRPS 16 /* Max. size of groups list */ 54#ifndef NFS_MINATTRTIMO 55#define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */ 56#endif 57#ifndef NFS_MAXATTRTIMO 58#define NFS_MAXATTRTIMO 60 59#endif 60#define NFS_WSIZE 8192 /* Def. write data size <= 8192 */ 61#define NFS_RSIZE 8192 /* Def. read data size <= 8192 */ 62#define NFS_DEFRAHEAD 1 /* Def. read ahead # blocks */ 63#define NFS_MAXRAHEAD 4 /* Max. read ahead # blocks */ 64#define NFS_MAXREADDIR NFS_MAXDATA /* Max. size of directory read */ 65#define NFS_MAXUIDHASH 64 /* Max. # of hashed uid entries/mp */ 66#define NFS_MAXASYNCDAEMON 20 /* Max. number async_daemons runable */ 67#define NFS_DIRBLKSIZ 1024 /* Size of an NFS directory block */ 68#define NMOD(a) ((a) % nfs_asyncdaemons) 69 70/* 71 * Set the attribute timeout based on how recently the file has been modified. 72 */ 73#define NFS_ATTRTIMEO(np) \ 74 ((((np)->n_flag & NMODIFIED) || \ 75 (time.tv_sec - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \ 76 ((time.tv_sec - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \ 77 (time.tv_sec - (np)->n_mtime) / 10)) 78 79/* 80 * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs 81 * should ever try and use it. 82 */ 83struct nfsd_args { 84 int sock; /* Socket to serve */ 85 caddr_t name; /* Client address for connection based sockets */ 86 int namelen; /* Length of name */ 87}; 88 89struct nfsd_srvargs { 90 struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */ 91 uid_t nsd_uid; /* Effective uid mapped to cred */ 92 u_long nsd_haddr; /* Ip address of client */ 93 struct ucred nsd_cr; /* Cred. uid maps to */ 94 int nsd_authlen; /* Length of auth string (ret) */ 95 char *nsd_authstr; /* Auth string (ret) */ 96}; 97 98struct nfsd_cargs { 99 char *ncd_dirp; /* Mount dir path */ 100 uid_t ncd_authuid; /* Effective uid */ 101 int ncd_authtype; /* Type of authenticator */ 102 int ncd_authlen; /* Length of authenticator string */ 103 char *ncd_authstr; /* Authenticator string */ 104}; 105 106/* 107 * Stats structure 108 */ 109struct nfsstats { 110 int attrcache_hits; 111 int attrcache_misses; 112 int lookupcache_hits; 113 int lookupcache_misses; 114 int direofcache_hits; 115 int direofcache_misses; 116 int biocache_reads; 117 int read_bios; 118 int read_physios; 119 int biocache_writes; 120 int write_bios; 121 int write_physios; 122 int biocache_readlinks; 123 int readlink_bios; 124 int biocache_readdirs; 125 int readdir_bios; 126 int rpccnt[NFS_NPROCS]; 127 int rpcretries; 128 int srvrpccnt[NFS_NPROCS]; 129 int srvrpc_errs; 130 int srv_errs; 131 int rpcrequests; 132 int rpctimeouts; 133 int rpcunexpected; 134 int rpcinvalid; 135 int srvcache_inproghits; 136 int srvcache_idemdonehits; 137 int srvcache_nonidemdonehits; 138 int srvcache_misses; 139 int srvnqnfs_leases; 140 int srvnqnfs_maxleases; 141 int srvnqnfs_getleases; 142}; 143 144/* 145 * Flags for nfssvc() system call. 146 */ 147#define NFSSVC_BIOD 0x002 148#define NFSSVC_NFSD 0x004 149#define NFSSVC_ADDSOCK 0x008 150#define NFSSVC_AUTHIN 0x010 151#define NFSSVC_GOTAUTH 0x040 152#define NFSSVC_AUTHINFAIL 0x080 153#define NFSSVC_MNTD 0x100 154 155/* 156 * The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts. 157 * What should be in this set is open to debate, but I believe that since 158 * I/O system calls on ufs are never interrupted by signals the set should 159 * be minimal. My reasoning is that many current programs that use signals 160 * such as SIGALRM will not expect file I/O system calls to be interrupted 161 * by them and break. 162 */ 163#ifdef KERNEL 164#define NFSINT_SIGMASK (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \ 165 sigmask(SIGHUP)|sigmask(SIGQUIT)) 166 167/* 168 * Socket errors ignored for connectionless sockets?? 169 * For now, ignore them all 170 */ 171#define NFSIGNORE_SOERROR(s, e) \ 172 ((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \ 173 ((s) & PR_CONNREQUIRED) == 0) 174 175/* 176 * Nfs outstanding request list element 177 */ 178struct nfsreq { 179 struct nfsreq *r_next; 180 struct nfsreq *r_prev; 181 struct mbuf *r_mreq; 182 struct mbuf *r_mrep; 183 struct mbuf *r_md; 184 caddr_t r_dpos; 185 struct nfsmount *r_nmp; 186 struct vnode *r_vp; 187 u_long r_xid; 188 int r_flags; /* flags on request, see below */ 189 int r_retry; /* max retransmission count */ 190 int r_rexmit; /* current retrans count */ 191 int r_timer; /* tick counter on reply */ 192 int r_procnum; /* NFS procedure number */ 193 int r_rtt; /* RTT for rpc */ 194 struct proc *r_procp; /* Proc that did I/O system call */ 195}; 196 197/* Flag values for r_flags */ 198#define R_TIMING 0x01 /* timing request (in mntp) */ 199#define R_SENT 0x02 /* request has been sent */ 200#define R_SOFTTERM 0x04 /* soft mnt, too many retries */ 201#define R_INTR 0x08 /* intr mnt, signal pending */ 202#define R_SOCKERR 0x10 /* Fatal error on socket */ 203#define R_TPRINTFMSG 0x20 /* Did a tprintf msg. */ 204#define R_MUSTRESEND 0x40 /* Must resend request */ 205#define R_GETONEREP 0x80 /* Probe for one reply only */ 206 207struct nfsstats nfsstats; 208 209/* 210 * A list of nfssvc_sock structures is maintained with all the sockets 211 * that require service by the nfsd. 212 * The nfsuid structs hang off of the nfssvc_sock structs in both lru 213 * and uid hash lists. 214 */ 215#define NUIDHASHSIZ 32 216#define NUIDHASH(uid) ((uid) & (NUIDHASHSIZ - 1)) 217 218/* 219 * Network address hash list element 220 */ 221union nethostaddr { 222 u_long had_inetaddr; 223 struct mbuf *had_nam; 224}; 225 226struct nfsuid { 227 struct nfsuid *nu_lrunext; /* MUST be first */ 228 struct nfsuid *nu_lruprev; 229 struct nfsuid *nu_hnext; 230 struct nfsuid *nu_hprev; 231 int nu_flag; /* Flags */ 232 uid_t nu_uid; /* Uid mapped by this entry */ 233 union nethostaddr nu_haddr; /* Host addr. for dgram sockets */ 234 struct ucred nu_cr; /* Cred uid mapped to */ 235}; 236 237#define nu_inetaddr nu_haddr.had_inetaddr 238#define nu_nam nu_haddr.had_nam 239/* Bits for nu_flag */ 240#define NU_INETADDR 0x1 241 242struct nfssvc_sock { 243 struct nfsuid *ns_lrunext; /* MUST be first */ 244 struct nfsuid *ns_lruprev; 245 struct nfssvc_sock *ns_next; 246 struct nfssvc_sock *ns_prev; 247 int ns_flag; 248 u_long ns_sref; 249 struct file *ns_fp; 250 struct socket *ns_so; 251 int ns_solock; 252 struct mbuf *ns_nam; 253 int ns_cc; 254 struct mbuf *ns_raw; 255 struct mbuf *ns_rawend; 256 int ns_reclen; 257 struct mbuf *ns_rec; 258 struct mbuf *ns_recend; 259 int ns_numuids; 260 struct nfsuid *ns_uidh[NUIDHASHSIZ]; 261}; 262 263/* Bits for "ns_flag" */ 264#define SLP_VALID 0x01 265#define SLP_DOREC 0x02 266#define SLP_NEEDQ 0x04 267#define SLP_DISCONN 0x08 268#define SLP_GETSTREAM 0x10 269#define SLP_INIT 0x20 270#define SLP_WANTINIT 0x40 271 272#define SLP_ALLFLAGS 0xff 273 274/* 275 * One of these structures is allocated for each nfsd. 276 */ 277struct nfsd { 278 struct nfsd *nd_next; /* Must be first */ 279 struct nfsd *nd_prev; 280 int nd_flag; /* NFSD_ flags */ 281 struct nfssvc_sock *nd_slp; /* Current socket */ 282 struct mbuf *nd_nam; /* Client addr for datagram req. */ 283 struct mbuf *nd_mrep; /* Req. mbuf list */ 284 struct mbuf *nd_md; 285 caddr_t nd_dpos; /* Position in list */ 286 int nd_procnum; /* RPC procedure number */ 287 u_long nd_retxid; /* RPC xid */ 288 int nd_repstat; /* Reply status value */ 289 struct ucred nd_cr; /* Credentials for req. */ 290 int nd_nqlflag; /* Leasing flag */ 291 int nd_duration; /* Lease duration */ 292 int nd_authlen; /* Authenticator len */ 293 u_char nd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */ 294 struct proc *nd_procp; /* Proc ptr */ 295}; 296 297#define NFSD_WAITING 0x01 298#define NFSD_CHECKSLP 0x02 299#define NFSD_REQINPROG 0x04 300#define NFSD_NEEDAUTH 0x08 301#define NFSD_AUTHFAIL 0x10 302#endif /* KERNEL */
| 43/* 44 * Tunable constants for nfs 45 */ 46 47#define NFS_MAXIOVEC 34 48#define NFS_HZ 25 /* Ticks per second for NFS timeouts */ 49#define NFS_TIMEO (1*NFS_HZ) /* Default timeout = 1 second */ 50#define NFS_MINTIMEO (1*NFS_HZ) /* Min timeout to use */ 51#define NFS_MAXTIMEO (60*NFS_HZ) /* Max timeout to backoff to */ 52#define NFS_MINIDEMTIMEO (5*NFS_HZ) /* Min timeout for non-idempotent ops*/ 53#define NFS_MAXREXMIT 100 /* Stop counting after this many */ 54#define NFS_MAXWINDOW 1024 /* Max number of outstanding requests */ 55#define NFS_RETRANS 10 /* Num of retrans for soft mounts */ 56#define NFS_MAXGRPS 16 /* Max. size of groups list */ 57#ifndef NFS_MINATTRTIMO 58#define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */ 59#endif 60#ifndef NFS_MAXATTRTIMO 61#define NFS_MAXATTRTIMO 60 62#endif 63#define NFS_WSIZE 8192 /* Def. write data size <= 8192 */ 64#define NFS_RSIZE 8192 /* Def. read data size <= 8192 */ 65#define NFS_DEFRAHEAD 1 /* Def. read ahead # blocks */ 66#define NFS_MAXRAHEAD 4 /* Max. read ahead # blocks */ 67#define NFS_MAXREADDIR NFS_MAXDATA /* Max. size of directory read */ 68#define NFS_MAXUIDHASH 64 /* Max. # of hashed uid entries/mp */ 69#define NFS_MAXASYNCDAEMON 20 /* Max. number async_daemons runable */ 70#define NFS_DIRBLKSIZ 1024 /* Size of an NFS directory block */ 71#define NMOD(a) ((a) % nfs_asyncdaemons) 72 73/* 74 * Set the attribute timeout based on how recently the file has been modified. 75 */ 76#define NFS_ATTRTIMEO(np) \ 77 ((((np)->n_flag & NMODIFIED) || \ 78 (time.tv_sec - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \ 79 ((time.tv_sec - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \ 80 (time.tv_sec - (np)->n_mtime) / 10)) 81 82/* 83 * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs 84 * should ever try and use it. 85 */ 86struct nfsd_args { 87 int sock; /* Socket to serve */ 88 caddr_t name; /* Client address for connection based sockets */ 89 int namelen; /* Length of name */ 90}; 91 92struct nfsd_srvargs { 93 struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */ 94 uid_t nsd_uid; /* Effective uid mapped to cred */ 95 u_long nsd_haddr; /* Ip address of client */ 96 struct ucred nsd_cr; /* Cred. uid maps to */ 97 int nsd_authlen; /* Length of auth string (ret) */ 98 char *nsd_authstr; /* Auth string (ret) */ 99}; 100 101struct nfsd_cargs { 102 char *ncd_dirp; /* Mount dir path */ 103 uid_t ncd_authuid; /* Effective uid */ 104 int ncd_authtype; /* Type of authenticator */ 105 int ncd_authlen; /* Length of authenticator string */ 106 char *ncd_authstr; /* Authenticator string */ 107}; 108 109/* 110 * Stats structure 111 */ 112struct nfsstats { 113 int attrcache_hits; 114 int attrcache_misses; 115 int lookupcache_hits; 116 int lookupcache_misses; 117 int direofcache_hits; 118 int direofcache_misses; 119 int biocache_reads; 120 int read_bios; 121 int read_physios; 122 int biocache_writes; 123 int write_bios; 124 int write_physios; 125 int biocache_readlinks; 126 int readlink_bios; 127 int biocache_readdirs; 128 int readdir_bios; 129 int rpccnt[NFS_NPROCS]; 130 int rpcretries; 131 int srvrpccnt[NFS_NPROCS]; 132 int srvrpc_errs; 133 int srv_errs; 134 int rpcrequests; 135 int rpctimeouts; 136 int rpcunexpected; 137 int rpcinvalid; 138 int srvcache_inproghits; 139 int srvcache_idemdonehits; 140 int srvcache_nonidemdonehits; 141 int srvcache_misses; 142 int srvnqnfs_leases; 143 int srvnqnfs_maxleases; 144 int srvnqnfs_getleases; 145}; 146 147/* 148 * Flags for nfssvc() system call. 149 */ 150#define NFSSVC_BIOD 0x002 151#define NFSSVC_NFSD 0x004 152#define NFSSVC_ADDSOCK 0x008 153#define NFSSVC_AUTHIN 0x010 154#define NFSSVC_GOTAUTH 0x040 155#define NFSSVC_AUTHINFAIL 0x080 156#define NFSSVC_MNTD 0x100 157 158/* 159 * The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts. 160 * What should be in this set is open to debate, but I believe that since 161 * I/O system calls on ufs are never interrupted by signals the set should 162 * be minimal. My reasoning is that many current programs that use signals 163 * such as SIGALRM will not expect file I/O system calls to be interrupted 164 * by them and break. 165 */ 166#ifdef KERNEL 167#define NFSINT_SIGMASK (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \ 168 sigmask(SIGHUP)|sigmask(SIGQUIT)) 169 170/* 171 * Socket errors ignored for connectionless sockets?? 172 * For now, ignore them all 173 */ 174#define NFSIGNORE_SOERROR(s, e) \ 175 ((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \ 176 ((s) & PR_CONNREQUIRED) == 0) 177 178/* 179 * Nfs outstanding request list element 180 */ 181struct nfsreq { 182 struct nfsreq *r_next; 183 struct nfsreq *r_prev; 184 struct mbuf *r_mreq; 185 struct mbuf *r_mrep; 186 struct mbuf *r_md; 187 caddr_t r_dpos; 188 struct nfsmount *r_nmp; 189 struct vnode *r_vp; 190 u_long r_xid; 191 int r_flags; /* flags on request, see below */ 192 int r_retry; /* max retransmission count */ 193 int r_rexmit; /* current retrans count */ 194 int r_timer; /* tick counter on reply */ 195 int r_procnum; /* NFS procedure number */ 196 int r_rtt; /* RTT for rpc */ 197 struct proc *r_procp; /* Proc that did I/O system call */ 198}; 199 200/* Flag values for r_flags */ 201#define R_TIMING 0x01 /* timing request (in mntp) */ 202#define R_SENT 0x02 /* request has been sent */ 203#define R_SOFTTERM 0x04 /* soft mnt, too many retries */ 204#define R_INTR 0x08 /* intr mnt, signal pending */ 205#define R_SOCKERR 0x10 /* Fatal error on socket */ 206#define R_TPRINTFMSG 0x20 /* Did a tprintf msg. */ 207#define R_MUSTRESEND 0x40 /* Must resend request */ 208#define R_GETONEREP 0x80 /* Probe for one reply only */ 209 210struct nfsstats nfsstats; 211 212/* 213 * A list of nfssvc_sock structures is maintained with all the sockets 214 * that require service by the nfsd. 215 * The nfsuid structs hang off of the nfssvc_sock structs in both lru 216 * and uid hash lists. 217 */ 218#define NUIDHASHSIZ 32 219#define NUIDHASH(uid) ((uid) & (NUIDHASHSIZ - 1)) 220 221/* 222 * Network address hash list element 223 */ 224union nethostaddr { 225 u_long had_inetaddr; 226 struct mbuf *had_nam; 227}; 228 229struct nfsuid { 230 struct nfsuid *nu_lrunext; /* MUST be first */ 231 struct nfsuid *nu_lruprev; 232 struct nfsuid *nu_hnext; 233 struct nfsuid *nu_hprev; 234 int nu_flag; /* Flags */ 235 uid_t nu_uid; /* Uid mapped by this entry */ 236 union nethostaddr nu_haddr; /* Host addr. for dgram sockets */ 237 struct ucred nu_cr; /* Cred uid mapped to */ 238}; 239 240#define nu_inetaddr nu_haddr.had_inetaddr 241#define nu_nam nu_haddr.had_nam 242/* Bits for nu_flag */ 243#define NU_INETADDR 0x1 244 245struct nfssvc_sock { 246 struct nfsuid *ns_lrunext; /* MUST be first */ 247 struct nfsuid *ns_lruprev; 248 struct nfssvc_sock *ns_next; 249 struct nfssvc_sock *ns_prev; 250 int ns_flag; 251 u_long ns_sref; 252 struct file *ns_fp; 253 struct socket *ns_so; 254 int ns_solock; 255 struct mbuf *ns_nam; 256 int ns_cc; 257 struct mbuf *ns_raw; 258 struct mbuf *ns_rawend; 259 int ns_reclen; 260 struct mbuf *ns_rec; 261 struct mbuf *ns_recend; 262 int ns_numuids; 263 struct nfsuid *ns_uidh[NUIDHASHSIZ]; 264}; 265 266/* Bits for "ns_flag" */ 267#define SLP_VALID 0x01 268#define SLP_DOREC 0x02 269#define SLP_NEEDQ 0x04 270#define SLP_DISCONN 0x08 271#define SLP_GETSTREAM 0x10 272#define SLP_INIT 0x20 273#define SLP_WANTINIT 0x40 274 275#define SLP_ALLFLAGS 0xff 276 277/* 278 * One of these structures is allocated for each nfsd. 279 */ 280struct nfsd { 281 struct nfsd *nd_next; /* Must be first */ 282 struct nfsd *nd_prev; 283 int nd_flag; /* NFSD_ flags */ 284 struct nfssvc_sock *nd_slp; /* Current socket */ 285 struct mbuf *nd_nam; /* Client addr for datagram req. */ 286 struct mbuf *nd_mrep; /* Req. mbuf list */ 287 struct mbuf *nd_md; 288 caddr_t nd_dpos; /* Position in list */ 289 int nd_procnum; /* RPC procedure number */ 290 u_long nd_retxid; /* RPC xid */ 291 int nd_repstat; /* Reply status value */ 292 struct ucred nd_cr; /* Credentials for req. */ 293 int nd_nqlflag; /* Leasing flag */ 294 int nd_duration; /* Lease duration */ 295 int nd_authlen; /* Authenticator len */ 296 u_char nd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */ 297 struct proc *nd_procp; /* Proc ptr */ 298}; 299 300#define NFSD_WAITING 0x01 301#define NFSD_CHECKSLP 0x02 302#define NFSD_REQINPROG 0x04 303#define NFSD_NEEDAUTH 0x08 304#define NFSD_AUTHFAIL 0x10 305#endif /* KERNEL */
|