Home | History | Annotate | Line # | Download | only in nfs
nfs_var.h revision 1.2
      1 /*	$NetBSD: nfs_var.h,v 1.2 1996/02/13 17:06:52 christos Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1996 Christos Zoulas.  All rights reserved.
      5  *
      6  * Redistribution and use in source and binary forms, with or without
      7  * modification, are permitted provided that the following conditions
      8  * are met:
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  * 3. All advertising materials mentioning features or use of this software
     15  *    must display the following acknowledgement:
     16  *	This product includes software developed by Christos Zoulas.
     17  * 4. The name of the author may not be used to endorse or promote products
     18  *    derived from this software without specific prior written permission.
     19  *
     20  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     21  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     22  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     23  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     25  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     29  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30  */
     31 
     32 struct vnode;
     33 struct uio;
     34 struct ucred;
     35 struct proc;
     36 struct buf;
     37 struct nfs_diskless;
     38 struct sockaddr_in;
     39 struct nfs_dlmount;
     40 struct vnode;
     41 struct nfsd;
     42 struct mbuf;
     43 struct file;
     44 struct nqlease;
     45 struct nqhost;
     46 struct nfssvc_sock;
     47 struct nfsmount;
     48 struct socket;
     49 struct nfsreq;
     50 struct vattr;
     51 struct nameidata;
     52 struct nfsnode;
     53 struct sillyrename;
     54 struct componentname;
     55 struct nfsd_srvargs;
     56 struct nfsd_cargs;
     57 
     58 
     59 /* nfs_bio.c */
     60 int nfs_bioread __P((struct vnode *, struct uio *, int, struct ucred *));
     61 struct buf *nfs_getcacheblk __P((struct vnode *, daddr_t, int, struct proc *));
     62 int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *,
     63 		       int));
     64 int nfs_asyncio __P((struct buf *, struct ucred *));
     65 int nfs_doio __P((struct buf *, struct ucred *, struct proc *));
     66 
     67 /* nfs_boot.c */
     68 int nfs_boot_init __P((struct nfs_diskless *, struct proc *));
     69 int nfs_boot_init __P((struct nfs_diskless *, struct proc *));
     70 
     71 /* nfs_node.c */
     72 void nfs_nhinit __P((void));
     73 struct nfsnodehashhead *nfs_hash __P((nfsv2fh_t *));
     74 int nfs_nget __P((struct mount *, nfsv2fh_t *, struct nfsnode **));
     75 
     76 /* nfs_vnops.c */
     77 int nfs_null __P((struct vnode *, struct ucred *, struct proc *));
     78 int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *));
     79 int nfs_readrpc __P((struct vnode *, struct uio *, struct ucred *));
     80 int nfs_writerpc __P((struct vnode *, struct uio *, struct ucred *, int));
     81 int nfs_removeit __P((struct sillyrename *));
     82 int nfs_renameit __P((struct vnode *, struct componentname *,
     83 		      struct sillyrename *));
     84 int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *));
     85 int nfs_readdirlookrpc __P((struct vnode *, struct uio *, struct ucred *));
     86 int nfs_sillyrename __P((struct vnode *, struct vnode *,
     87 			 struct componentname *));
     88 int nfs_lookitup __P((struct sillyrename *, nfsv2fh_t *, struct proc *));
     89 
     90 /* nfs_nqlease.c */
     91 int nqsrv_getlease __P((struct vnode *, u_int *, int, struct nfsd *,
     92 			struct mbuf *, int *, u_quad_t *, struct ucred *));
     93 int lease_check __P((void *));
     94 void nqsrv_addhost __P((struct nqhost *, struct nfssvc_sock *, struct mbuf *));
     95 void nqsrv_instimeq __P((struct nqlease *, u_long));
     96 int nqsrv_cmpnam __P((struct nfssvc_sock *, struct mbuf *, struct nqhost *));
     97 void nqsrv_send_eviction __P((struct vnode *, struct nqlease *,
     98 			      struct nfssvc_sock *, struct mbuf *,
     99 			      struct ucred *));
    100 void nqsrv_waitfor_expiry __P((struct nqlease *));
    101 void nqnfs_serverd __P((void));
    102 int nqnfsrv_getlease __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    103 			  struct ucred *, struct mbuf *, struct mbuf **));
    104 int nqnfsrv_vacated __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    105 			 struct ucred *, struct mbuf *, struct mbuf **));
    106 int nqnfs_getlease __P((struct vnode *, int, struct ucred *, struct proc *));
    107 int nqnfs_vacated __P((struct vnode *, struct ucred *));
    108 int nqnfs_callback __P((struct nfsmount *, struct mbuf *, struct mbuf *,
    109 		 	caddr_t));
    110 int nqnfs_clientd __P((struct nfsmount *, struct ucred *, struct nfsd_cargs *,
    111 	               int, caddr_t, struct proc *));
    112 void nqnfs_clientlease __P((struct nfsmount *, struct nfsnode *, int, int ,
    113 			    time_t, u_quad_t));
    114 void lease_updatetime __P((int));
    115 void nqsrv_locklease __P((struct nqlease *));
    116 void nqsrv_unlocklease __P((struct nqlease *));
    117 
    118 /* nfs_serv.c */
    119 int nqnfsrv_access __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    120 			struct ucred *, struct mbuf *, struct mbuf **));
    121 int nfsrv_getattr __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    122 		       struct ucred *, struct mbuf *, struct mbuf **));
    123 int nfsrv_setattr __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    124 		       struct ucred *, struct mbuf *, struct mbuf **));
    125 int nfsrv_lookup __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    126 		      struct ucred *, struct mbuf *, struct mbuf **));
    127 int nfsrv_readlink __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    128 			struct ucred *, struct mbuf *, struct mbuf **));
    129 int nfsrv_read __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    130 		    struct ucred *, struct mbuf *, struct mbuf **));
    131 int nfsrv_write __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    132 		     struct ucred *, struct mbuf *, struct mbuf **));
    133 int nfsrv_create __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    134 		      struct ucred *, struct mbuf *, struct mbuf **));
    135 int nfsrv_remove __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    136 		      struct ucred *, struct mbuf *, struct mbuf **));
    137 int nfsrv_rename __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    138 		      struct ucred *, struct mbuf *, struct mbuf **));
    139 int nfsrv_link __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    140 		    struct ucred *, struct mbuf *, struct mbuf **));
    141 int nfsrv_symlink __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    142 		       struct ucred *, struct mbuf *, struct mbuf **));
    143 int nfsrv_mkdir __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    144 		     struct ucred *, struct mbuf *, struct mbuf **));
    145 int nfsrv_rmdir __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    146 		     struct ucred *, struct mbuf *, struct mbuf **));
    147 int nfsrv_readdir __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    148 		       struct ucred *, struct mbuf *, struct mbuf **));
    149 int nqnfsrv_readdirlook __P((struct nfsd *, struct mbuf *, struct mbuf *,
    150 			     caddr_t, struct ucred *, struct mbuf *,
    151 			     struct mbuf **));
    152 int nfsrv_statfs __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    153 		      struct ucred *, struct mbuf *, struct mbuf **));
    154 int nfsrv_null __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    155 		    struct ucred *, struct mbuf *, struct mbuf **));
    156 int nfsrv_noop __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
    157 		    struct ucred *, struct mbuf *, struct mbuf **));
    158 int nfsrv_access __P((struct vnode *, int, struct ucred *, int, struct proc *));
    159 
    160 /* nfs_socket.c */
    161 int nfs_connect __P((struct nfsmount *, struct nfsreq *));
    162 int nfs_reconnect __P((struct nfsreq *));
    163 void nfs_disconnect __P((struct nfsmount *));
    164 int nfs_send __P((struct socket *, struct mbuf *, struct mbuf *,
    165 		  struct nfsreq *));
    166 int nfs_receive __P((struct nfsreq *, struct mbuf **, struct mbuf **));
    167 int nfs_reply __P((struct nfsreq *));
    168 int nfs_request __P((struct vnode *, struct mbuf *, int, struct proc *,
    169 		     struct ucred *, struct mbuf **, struct mbuf **,
    170 		     caddr_t *));
    171 int nfs_rephead __P((int, struct nfsd *, int, int, u_quad_t *, struct mbuf **,
    172 		     struct mbuf **, caddr_t *));
    173 void nfs_timer __P((void *));
    174 int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *));
    175 int nfs_sndlock __P((int *, struct nfsreq *));
    176 void nfs_sndunlock __P((int *));
    177 int nfs_rcvlock __P((struct nfsreq *));
    178 void nfs_rcvunlock __P((int *));
    179 void nfs_realign __P((struct mbuf *, int));
    180 int nfs_getreq __P((struct nfsd *, int));
    181 void nfs_msg __P((struct proc *, char *, char *));
    182 void nfsrv_rcv __P((struct socket *, caddr_t, int));
    183 int nfsrv_getstream __P((struct nfssvc_sock *, int));
    184 int nfsrv_dorec __P((struct nfssvc_sock *, struct nfsd *));
    185 void nfsrv_wakenfsd __P((struct nfssvc_sock *));
    186 
    187 /* nfs_srvcache.c */
    188 void nfsrv_initcache __P((void));
    189 int nfsrv_getcache __P((struct mbuf *, struct nfsd *, struct mbuf **));
    190 void nfsrv_updatecache __P((struct mbuf *, struct nfsd *, int, struct mbuf *));
    191 void nfsrv_cleancache __P((void));
    192 
    193 /* nfs_subs.c */
    194 struct mbuf *nfsm_reqh __P((struct vnode *, u_long, int, caddr_t *));
    195 struct mbuf *nfsm_rpchead __P((struct ucred *, int, int, int, int, char *,
    196 			       struct mbuf *, int, struct mbuf **,
    197 			       u_int32_t *));
    198 int nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *));
    199 int nfsm_uiotombuf __P((struct uio *, struct mbuf **, int, caddr_t *));
    200 int nfsm_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
    201 int nfs_adv __P((struct mbuf **, caddr_t *, int, int));
    202 int nfsm_strtmbuf __P((struct mbuf **, char **, char *, long));
    203 int nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *,
    204 			   struct vattr *));
    205 int nfs_getattrcache __P((struct vnode *, struct vattr *));
    206 int nfs_namei __P((struct nameidata *, fhandle_t *, int, struct nfssvc_sock *,
    207 		   struct mbuf *, struct mbuf **, caddr_t *, struct proc *));
    208 void nfsm_adj __P((struct mbuf *, int, int));
    209 int nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *,
    210 		      struct nfssvc_sock *, struct mbuf *, int *));
    211 int netaddr_match __P((int, union nethostaddr *, struct mbuf *));
    212 
    213 /* nfs_syscalls.c */
    214 int nfssvc_addsock __P((struct file *, struct mbuf *));
    215 int nfssvc_nfsd __P((struct nfsd_srvargs *, caddr_t, struct proc *));
    216 void nfsrv_zapsock __P((struct nfssvc_sock *));
    217 void nfsrv_slpderef __P((struct nfssvc_sock *));
    218 void nfsrv_init __P((int));
    219 int nfssvc_iod __P((struct proc *));
    220 int nfs_getauth __P((struct nfsmount *, struct nfsreq *, struct ucred *,
    221 		     int *, char **, int *));
    222 
    223