Home | History | Annotate | Line # | Download | only in nfs
nfs_var.h revision 1.92.2.2
      1  1.92.2.2       riz /*	$NetBSD: nfs_var.h,v 1.92.2.2 2015/11/04 17:46:21 riz Exp $	*/
      2       1.1  christos 
      3      1.15  christos /*-
      4      1.15  christos  * Copyright (c) 1996 The NetBSD Foundation, Inc.
      5      1.15  christos  * All rights reserved.
      6      1.15  christos  *
      7      1.15  christos  * This code is derived from software contributed to The NetBSD Foundation
      8      1.15  christos  * by Christos Zoulas.
      9       1.1  christos  *
     10       1.1  christos  * Redistribution and use in source and binary forms, with or without
     11       1.1  christos  * modification, are permitted provided that the following conditions
     12       1.1  christos  * are met:
     13       1.1  christos  * 1. Redistributions of source code must retain the above copyright
     14       1.1  christos  *    notice, this list of conditions and the following disclaimer.
     15       1.1  christos  * 2. Redistributions in binary form must reproduce the above copyright
     16       1.1  christos  *    notice, this list of conditions and the following disclaimer in the
     17       1.1  christos  *    documentation and/or other materials provided with the distribution.
     18       1.1  christos  *
     19      1.15  christos  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20      1.15  christos  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21      1.15  christos  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22      1.15  christos  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23      1.15  christos  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24      1.15  christos  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25      1.15  christos  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26      1.15  christos  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27      1.15  christos  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28      1.15  christos  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29      1.15  christos  * POSSIBILITY OF SUCH DAMAGE.
     30       1.1  christos  */
     31       1.1  christos 
     32       1.3      fvdl /*
     33       1.3      fvdl  * XXX needs <nfs/rpcv2.h> and <nfs/nfs.h> because of typedefs
     34       1.3      fvdl  */
     35      1.27   thorpej 
     36      1.28  christos #ifdef _KERNEL
     37      1.27   thorpej #include <sys/mallocvar.h>
     38      1.37      yamt #include <sys/pool.h>
     39      1.27   thorpej 
     40       1.1  christos struct vnode;
     41       1.1  christos struct uio;
     42       1.1  christos struct proc;
     43       1.1  christos struct buf;
     44       1.1  christos struct nfs_diskless;
     45       1.1  christos struct sockaddr_in;
     46       1.1  christos struct nfs_dlmount;
     47       1.1  christos struct vnode;
     48       1.1  christos struct nfsd;
     49       1.1  christos struct mbuf;
     50       1.1  christos struct file;
     51       1.1  christos struct nfssvc_sock;
     52       1.1  christos struct nfsmount;
     53       1.1  christos struct socket;
     54       1.1  christos struct nfsreq;
     55       1.1  christos struct vattr;
     56       1.1  christos struct nameidata;
     57       1.1  christos struct nfsnode;
     58       1.1  christos struct sillyrename;
     59       1.1  christos struct componentname;
     60       1.2  christos struct nfsd_srvargs;
     61       1.3      fvdl struct nfsrv_descript;
     62       1.3      fvdl struct nfs_fattr;
     63      1.10      fvdl struct nfsdircache;
     64      1.13       mrg union nethostaddr;
     65       1.1  christos 
     66       1.1  christos /* nfs_bio.c */
     67      1.59      elad int nfs_bioread(struct vnode *, struct uio *, int, kauth_cred_t, int);
     68      1.57      yamt struct buf *nfs_getcacheblk(struct vnode *, daddr_t, int, struct lwp *);
     69      1.59      elad int nfs_vinvalbuf(struct vnode *, int, kauth_cred_t, struct lwp *, int);
     70      1.59      elad int nfs_flushstalebuf(struct vnode *, kauth_cred_t, struct lwp *, int);
     71      1.47      yamt #define	NFS_FLUSHSTALEBUF_MYWRITE	1	/* assume writes are ours */
     72      1.57      yamt int nfs_asyncio(struct buf *);
     73      1.57      yamt int nfs_doio(struct buf *);
     74       1.1  christos 
     75       1.1  christos /* nfs_boot.c */
     76       1.9       gwr /* see nfsdiskless.h */
     77      1.25  jdolecek 
     78      1.25  jdolecek /* nfs_kq.c */
     79      1.57      yamt void nfs_kqinit(void);
     80      1.84        ad void nfs_kqfini(void);
     81       1.1  christos 
     82       1.1  christos /* nfs_node.c */
     83      1.82      matt void nfs_node_init(void);
     84      1.80     pooka void nfs_node_done(void);
     85      1.81      matt 
     86      1.57      yamt int nfs_nget1(struct mount *, nfsfh_t *, int, struct nfsnode **, int);
     87      1.43      yamt #define	nfs_nget(mp, fhp, fhsize, npp) \
     88      1.43      yamt 	nfs_nget1((mp), (fhp), (fhsize), (npp), 0)
     89       1.1  christos 
     90       1.1  christos /* nfs_vnops.c */
     91      1.59      elad int nfs_null(struct vnode *, kauth_cred_t, struct lwp *);
     92      1.59      elad int nfs_setattrrpc(struct vnode *, struct vattr *, kauth_cred_t, struct lwp *);
     93      1.59      elad int nfs_readlinkrpc(struct vnode *, struct uio *, kauth_cred_t);
     94      1.57      yamt int nfs_readrpc(struct vnode *, struct uio *);
     95      1.65   thorpej int nfs_writerpc(struct vnode *, struct uio *, int *, bool, bool *);
     96      1.57      yamt int nfs_mknodrpc(struct vnode *, struct vnode **, struct componentname *,
     97      1.57      yamt 	struct vattr *);
     98      1.57      yamt int nfs_removeit(struct sillyrename *);
     99      1.59      elad int nfs_removerpc(struct vnode *, const char *, int, kauth_cred_t,
    100      1.57      yamt 	struct lwp *);
    101      1.57      yamt int nfs_renameit(struct vnode *, struct componentname *, struct sillyrename *);
    102      1.57      yamt int nfs_renamerpc(struct vnode *, const char *, int, struct vnode *,
    103      1.59      elad 	const char *, int, kauth_cred_t, struct lwp *);
    104      1.59      elad int nfs_readdirrpc(struct vnode *, struct uio *, kauth_cred_t);
    105      1.59      elad int nfs_readdirplusrpc(struct vnode *, struct uio *, kauth_cred_t);
    106      1.62      yamt int nfs_sillyrename(struct vnode *, struct vnode *, struct componentname *,
    107      1.65   thorpej 	bool);
    108      1.59      elad int nfs_lookitup(struct vnode *, const char *, int, kauth_cred_t,
    109      1.57      yamt 	struct lwp *, struct nfsnode **);
    110      1.57      yamt int nfs_commit(struct vnode *, off_t, uint32_t, struct lwp *);
    111      1.59      elad int nfs_flush(struct vnode *, kauth_cred_t, int, struct lwp *, int);
    112       1.1  christos 
    113       1.1  christos /* nfs_serv.c */
    114      1.57      yamt int nfsrv3_access(struct nfsrv_descript *, struct nfssvc_sock *,
    115      1.57      yamt 	struct lwp *, struct mbuf **);
    116      1.57      yamt int nfsrv_getattr(struct nfsrv_descript *, struct nfssvc_sock *,
    117      1.57      yamt 	struct lwp *, struct mbuf **);
    118      1.57      yamt int nfsrv_setattr(struct nfsrv_descript *, struct nfssvc_sock *,
    119      1.57      yamt 	struct lwp *, struct mbuf **);
    120      1.57      yamt int nfsrv_lookup(struct nfsrv_descript *, struct nfssvc_sock *,
    121      1.57      yamt 	struct lwp *, struct mbuf **);
    122      1.57      yamt int nfsrv_readlink(struct nfsrv_descript *, struct nfssvc_sock *,
    123      1.57      yamt 	struct lwp *, struct mbuf **);
    124      1.57      yamt int nfsrv_read(struct nfsrv_descript *, struct nfssvc_sock *,
    125      1.57      yamt 	struct lwp *, struct mbuf **);
    126      1.57      yamt int nfsrv_write(struct nfsrv_descript *, struct nfssvc_sock *,
    127      1.57      yamt 	struct lwp *, struct mbuf **);
    128      1.57      yamt int nfsrv_writegather(struct nfsrv_descript **, struct nfssvc_sock *,
    129      1.57      yamt 	struct lwp *, struct mbuf **);
    130      1.57      yamt void nfsrvw_coalesce(struct nfsrv_descript *, struct nfsrv_descript *);
    131      1.57      yamt int nfsrv_create(struct nfsrv_descript *, struct nfssvc_sock *,
    132      1.57      yamt 	struct lwp *, struct mbuf **);
    133      1.57      yamt int nfsrv_mknod(struct nfsrv_descript *, struct nfssvc_sock *,
    134      1.57      yamt 	struct lwp *, struct mbuf **);
    135      1.57      yamt int nfsrv_remove(struct nfsrv_descript *, struct nfssvc_sock *,
    136      1.57      yamt 	struct lwp *, struct mbuf **);
    137      1.57      yamt int nfsrv_rename(struct nfsrv_descript *, struct nfssvc_sock *,
    138      1.57      yamt 	struct lwp *, struct mbuf **);
    139      1.57      yamt int nfsrv_link(struct nfsrv_descript *, struct nfssvc_sock *,
    140      1.57      yamt 	struct lwp *, struct mbuf **);
    141      1.57      yamt int nfsrv_symlink(struct nfsrv_descript *, struct nfssvc_sock *,
    142      1.57      yamt 	struct lwp *, struct mbuf **);
    143      1.57      yamt int nfsrv_mkdir(struct nfsrv_descript *, struct nfssvc_sock *,
    144      1.57      yamt 	struct lwp *, struct mbuf **);
    145      1.57      yamt int nfsrv_rmdir(struct nfsrv_descript *, struct nfssvc_sock *,
    146      1.57      yamt 	struct lwp *, struct mbuf **);
    147      1.57      yamt int nfsrv_readdir(struct nfsrv_descript *, struct nfssvc_sock *,
    148      1.57      yamt 	struct lwp *, struct mbuf **);
    149      1.57      yamt int nfsrv_readdirplus(struct nfsrv_descript *, struct nfssvc_sock *,
    150      1.57      yamt 	struct lwp *, struct mbuf **);
    151      1.57      yamt int nfsrv_commit(struct nfsrv_descript *, struct nfssvc_sock *,
    152      1.57      yamt 	struct lwp *, struct mbuf **);
    153      1.57      yamt int nfsrv_statfs(struct nfsrv_descript *, struct nfssvc_sock *,
    154      1.57      yamt 	struct lwp *, struct mbuf **);
    155      1.57      yamt int nfsrv_fsinfo(struct nfsrv_descript *, struct nfssvc_sock *,
    156      1.57      yamt 	struct lwp *, struct mbuf **);
    157      1.57      yamt int nfsrv_pathconf(struct nfsrv_descript *, struct nfssvc_sock *,
    158      1.57      yamt 	struct lwp *, struct mbuf **);
    159      1.57      yamt int nfsrv_null(struct nfsrv_descript *, struct nfssvc_sock *,
    160      1.57      yamt 	struct lwp *, struct mbuf **);
    161      1.57      yamt int nfsrv_noop(struct nfsrv_descript *, struct nfssvc_sock *,
    162      1.57      yamt 	struct lwp *, struct mbuf **);
    163      1.59      elad int nfsrv_access(struct vnode *, int, kauth_cred_t, int, struct lwp *, int);
    164       1.1  christos 
    165       1.1  christos /* nfs_socket.c */
    166      1.57      yamt int nfs_connect(struct nfsmount *, struct nfsreq *, struct lwp *);
    167      1.73      yamt int nfs_reconnect(struct nfsreq *);
    168      1.57      yamt void nfs_disconnect(struct nfsmount *);
    169      1.57      yamt void nfs_safedisconnect(struct nfsmount *);
    170      1.57      yamt int nfs_send(struct socket *, struct mbuf *, struct mbuf *, struct nfsreq *,
    171      1.57      yamt 	struct lwp *);
    172      1.57      yamt int nfs_request(struct nfsnode *, struct mbuf *, int, struct lwp *,
    173      1.66  christos 	kauth_cred_t, struct mbuf **, struct mbuf **, char **, int *);
    174      1.57      yamt int nfs_rephead(int, struct nfsrv_descript *, struct nfssvc_sock *,
    175      1.66  christos 	int, int, u_quad_t *, struct mbuf **, struct mbuf **, char **);
    176      1.57      yamt void nfs_timer(void *);
    177      1.71      yamt void nfs_timer_init(void);
    178      1.84        ad void nfs_timer_fini(void);
    179      1.71      yamt void nfs_timer_start(void);
    180      1.84        ad void nfs_timer_srvinit(bool (*)(void));
    181      1.84        ad void nfs_timer_srvfini(void);
    182      1.57      yamt int nfs_sigintr(struct nfsmount *, struct nfsreq *, struct lwp *);
    183      1.57      yamt int nfs_getreq(struct nfsrv_descript *, struct nfsd *, int);
    184      1.57      yamt int nfs_msg(struct lwp *, const char *, const char *);
    185      1.89       tls void nfsrv_soupcall(struct socket *, void *, int, int);
    186      1.75      yamt void nfsrv_rcv(struct nfssvc_sock *);
    187      1.57      yamt int nfsrv_getstream(struct nfssvc_sock *, int);
    188      1.75      yamt int nfsrv_dorec(struct nfssvc_sock *, struct nfsd *, struct nfsrv_descript **,
    189      1.75      yamt     bool *);
    190      1.57      yamt void nfsrv_wakenfsd(struct nfssvc_sock *);
    191      1.65   thorpej int nfsdsock_lock(struct nfssvc_sock *, bool);
    192      1.56      yamt void nfsdsock_unlock(struct nfssvc_sock *);
    193      1.56      yamt int nfsdsock_drain(struct nfssvc_sock *);
    194      1.56      yamt int nfsdsock_sendreply(struct nfssvc_sock *, struct nfsrv_descript *);
    195      1.61      yamt void nfsdreq_init(void);
    196      1.84        ad void nfsdreq_fini(void);
    197      1.61      yamt struct nfsrv_descript *nfsdreq_alloc(void);
    198      1.60      yamt void nfsdreq_free(struct nfsrv_descript *);
    199      1.84        ad bool nfsrv_timer(void);
    200      1.90     pooka int nfs_rcvlock(struct nfsmount *, struct nfsreq *);
    201      1.90     pooka void nfs_rcvunlock(struct nfsmount *);
    202       1.1  christos 
    203      1.75      yamt void nfsdsock_setbits(struct nfssvc_sock *, int);
    204      1.75      yamt void nfsdsock_clearbits(struct nfssvc_sock *, int);
    205      1.75      yamt bool nfsdsock_testbits(struct nfssvc_sock *, int);
    206      1.75      yamt 
    207      1.90     pooka /*
    208      1.90     pooka  * Estimate rto for an nfs rpc sent via. an unreliable datagram.
    209      1.90     pooka  * Use the mean and mean deviation of rtt for the appropriate type of rpc
    210      1.90     pooka  * for the frequent rpcs and a default for the others.
    211      1.90     pooka  * The justification for doing "other" this way is that these rpcs
    212      1.90     pooka  * happen so infrequently that timer est. would probably be stale.
    213      1.90     pooka  * Also, since many of these rpcs are
    214      1.90     pooka  * non-idempotent, a conservative timeout is desired.
    215      1.90     pooka  * getattr, lookup - A+2D
    216      1.90     pooka  * read, write     - A+4D
    217      1.90     pooka  * other           - nm_timeo
    218      1.90     pooka  */
    219      1.90     pooka #define	NFS_RTO(n, t) \
    220      1.90     pooka 	((t) == 0 ? (n)->nm_timeo : \
    221      1.90     pooka 	 ((t) < 3 ? \
    222      1.90     pooka 	  (((((n)->nm_srtt[t-1] + 3) >> 2) + (n)->nm_sdrtt[t-1] + 1) >> 1) : \
    223      1.90     pooka 	  ((((n)->nm_srtt[t-1] + 7) >> 3) + (n)->nm_sdrtt[t-1] + 1)))
    224      1.90     pooka #define	NFS_SRTT(r)	(r)->r_nmp->nm_srtt[nfs_proct[(r)->r_procnum] - 1]
    225      1.90     pooka #define	NFS_SDRTT(r)	(r)->r_nmp->nm_sdrtt[nfs_proct[(r)->r_procnum] - 1]
    226      1.90     pooka 
    227      1.90     pooka extern int nfsrtton;
    228      1.90     pooka extern struct nfsrtt nfsrtt;
    229      1.90     pooka extern const int nfs_proct[];
    230      1.90     pooka 
    231      1.90     pooka extern const struct timeval nfs_err_interval;
    232      1.90     pooka extern struct timeval nfs_reply_last_err_time;
    233      1.90     pooka extern struct timeval nfs_timer_last_err_time;
    234      1.90     pooka 
    235      1.90     pooka 
    236       1.1  christos /* nfs_srvcache.c */
    237      1.57      yamt void nfsrv_initcache(void);
    238      1.84        ad void nfsrv_finicache(void);
    239      1.57      yamt int nfsrv_getcache(struct nfsrv_descript *, struct nfssvc_sock *,
    240      1.57      yamt 	struct mbuf **);
    241      1.57      yamt void nfsrv_updatecache(struct nfsrv_descript *, int, struct mbuf *);
    242      1.57      yamt void nfsrv_cleancache(void);
    243       1.1  christos 
    244       1.1  christos /* nfs_subs.c */
    245      1.66  christos struct mbuf *nfsm_reqh(struct nfsnode *, u_long, int, char **);
    246      1.59      elad struct mbuf *nfsm_rpchead(kauth_cred_t, int, int, int, int, char *, int,
    247      1.57      yamt 	char *, struct mbuf *, int, struct mbuf **, u_int32_t *);
    248      1.66  christos int nfsm_mbuftouio(struct mbuf **, struct uio *, int, char **);
    249      1.66  christos int nfsm_uiotombuf(struct uio *, struct mbuf **, int, char **);
    250      1.66  christos int nfsm_disct(struct mbuf **, char **, int, int, char **);
    251      1.66  christos int nfs_adv(struct mbuf **, char **, int, int);
    252      1.57      yamt int nfsm_strtmbuf(struct mbuf **, char **, const char *, long);
    253      1.57      yamt u_long nfs_dirhash(off_t);
    254      1.57      yamt void nfs_initdircache(struct vnode *);
    255      1.57      yamt void nfs_initdirxlatecookie(struct vnode *);
    256      1.57      yamt struct nfsdircache *nfs_searchdircache(struct vnode *, off_t, int, int *);
    257      1.57      yamt struct nfsdircache *nfs_enterdircache(struct vnode *, off_t, off_t, int,
    258      1.57      yamt 	daddr_t);
    259      1.57      yamt void nfs_putdircache(struct nfsnode *, struct nfsdircache *);
    260      1.57      yamt void nfs_invaldircache(struct vnode *, int);
    261      1.49      yamt #define	NFS_INVALDIRCACHE_FORCE		1
    262      1.49      yamt #define	NFS_INVALDIRCACHE_KEEPEOF	2
    263      1.84        ad void nfs_init(void);
    264      1.84        ad void nfs_fini(void);
    265      1.66  christos int nfsm_loadattrcache(struct vnode **, struct mbuf **, char **,
    266      1.57      yamt 	struct vattr *, int flags);
    267      1.57      yamt int nfs_loadattrcache(struct vnode **, struct nfs_fattr *, struct vattr *,
    268      1.57      yamt 	int flags);
    269      1.57      yamt int nfs_getattrcache(struct vnode *, struct vattr *);
    270      1.57      yamt void nfs_delayedtruncate(struct vnode *);
    271      1.57      yamt int nfs_check_wccdata(struct nfsnode *, const struct timespec *,
    272      1.65   thorpej 	struct timespec *, bool);
    273      1.63      yamt int nfs_namei(struct nameidata *, nfsrvfh_t *, uint32_t, struct nfssvc_sock *,
    274      1.66  christos 	struct mbuf *, struct mbuf **, char **, struct vnode **, struct lwp *,
    275      1.57      yamt 	int, int);
    276      1.57      yamt void nfs_zeropad(struct mbuf *, int, int);
    277      1.57      yamt void nfsm_srvwcc(struct nfsrv_descript *, int, struct vattr *, int,
    278      1.57      yamt 	struct vattr *, struct mbuf **, char **);
    279      1.57      yamt void nfsm_srvpostopattr(struct nfsrv_descript *, int, struct vattr *,
    280      1.57      yamt 	struct mbuf **, char **);
    281      1.57      yamt void nfsm_srvfattr(struct nfsrv_descript *, struct vattr *, struct nfs_fattr *);
    282      1.63      yamt int nfsrv_fhtovp(nfsrvfh_t *, int, struct vnode **, kauth_cred_t,
    283      1.57      yamt 	struct nfssvc_sock *, struct mbuf *, int *, int, int);
    284      1.86       dsl int nfs_ispublicfh(const nfsrvfh_t *);
    285      1.57      yamt int netaddr_match(int, union nethostaddr *, struct mbuf *);
    286      1.74      yamt time_t nfs_attrtimeo(struct nfsmount *, struct nfsnode *);
    287      1.24      yamt 
    288      1.24      yamt /* flags for nfs_loadattrcache and friends */
    289      1.24      yamt #define	NAC_NOTRUNC	1	/* don't truncate file size */
    290      1.18      fvdl 
    291      1.57      yamt void nfs_clearcommit(struct mount *);
    292      1.57      yamt void nfs_merge_commit_ranges(struct vnode *);
    293      1.57      yamt int nfs_in_committed_range(struct vnode *, off_t, off_t);
    294      1.57      yamt int nfs_in_tobecommitted_range(struct vnode *, off_t, off_t);
    295      1.57      yamt void nfs_add_committed_range(struct vnode *, off_t, off_t);
    296      1.57      yamt void nfs_del_committed_range(struct vnode *, off_t, off_t);
    297      1.57      yamt void nfs_add_tobecommitted_range(struct vnode *, off_t, off_t);
    298      1.57      yamt void nfs_del_tobecommitted_range(struct vnode *, off_t, off_t);
    299      1.57      yamt 
    300      1.57      yamt int nfsrv_errmap(struct nfsrv_descript *, int);
    301      1.59      elad void nfs_cookieheuristic(struct vnode *, int *, struct lwp *, kauth_cred_t);
    302      1.42      yamt 
    303      1.57      yamt u_int32_t nfs_getxid(void);
    304      1.57      yamt void nfs_renewxid(struct nfsreq *);
    305       1.1  christos 
    306      1.65   thorpej int nfsrv_composefh(struct vnode *, nfsrvfh_t *, bool);
    307      1.63      yamt int nfsrv_comparefh(const nfsrvfh_t *, const nfsrvfh_t *);
    308      1.63      yamt void nfsrv_copyfh(nfsrvfh_t *, const nfsrvfh_t *);
    309      1.63      yamt 
    310      1.90     pooka extern const enum vtype nv2tov_type[8];
    311      1.90     pooka extern const enum vtype nv3tov_type[8];
    312      1.90     pooka 
    313      1.90     pooka extern u_int32_t rpc_reply, rpc_msgdenied, rpc_mismatch, rpc_vers,
    314      1.90     pooka         rpc_auth_unix, rpc_msgaccepted, rpc_call, rpc_autherr,
    315      1.90     pooka 	rpc_auth_kerb;
    316      1.90     pooka extern u_int32_t nfs_prog;
    317      1.90     pooka extern const int nfsv3_procid[NFS_NPROCS];
    318      1.90     pooka extern int nfs_ticks;
    319      1.90     pooka 
    320       1.1  christos /* nfs_syscalls.c */
    321      1.76       dsl struct sys_getfh_args;
    322      1.76       dsl struct sys_nfssvc_args;
    323      1.76       dsl int sys_getfh(struct lwp *, const struct sys_getfh_args *, register_t *);
    324      1.76       dsl int sys_nfssvc(struct lwp *, const struct sys_nfssvc_args *, register_t *);
    325      1.57      yamt int nfssvc_addsock(struct file *, struct mbuf *);
    326      1.57      yamt void nfsrv_zapsock(struct nfssvc_sock *);
    327      1.57      yamt void nfsrv_slpderef(struct nfssvc_sock *);
    328      1.57      yamt void nfsrv_init(int);
    329      1.84        ad void nfsrv_fini(void);
    330      1.57      yamt void nfs_iodinit(void);
    331      1.84        ad void nfs_iodfini(void);
    332  1.92.2.1       riz int nfs_iodbusy(struct nfsmount *);
    333      1.72      yamt int nfs_set_niothreads(int);
    334      1.59      elad int nfs_getauth(struct nfsmount *, struct nfsreq *, kauth_cred_t, char **,
    335      1.57      yamt 	int *, char *, int *, NFSKERBKEY_T);
    336      1.59      elad int nfs_getnickauth(struct nfsmount *, kauth_cred_t, char **, int *, char *,
    337      1.57      yamt 	int);
    338      1.59      elad int nfs_savenickauth(struct nfsmount *, kauth_cred_t, int, NFSKERBKEY_T,
    339      1.57      yamt 	struct mbuf **, char **, struct mbuf *);
    340  1.92.2.2       riz /*
    341  1.92.2.2       riz  * Backend copyin/out functions for nfssvc(2), so that netbsd32 can
    342  1.92.2.2       riz  * easily access NFS.  Each operation either must perform a copyin or
    343  1.92.2.2       riz  * copyout of the right data for the emulation.  exp_in() takes a count
    344  1.92.2.2       riz  * of the number of export_args to copyin, and order arguments for
    345  1.92.2.2       riz  * func(dst, src).
    346  1.92.2.2       riz  */
    347  1.92.2.2       riz struct nfssvc_copy_ops {
    348  1.92.2.2       riz 	int (*addsock_in)(struct nfsd_args *, const void *);
    349  1.92.2.2       riz 	int (*setexports_in)(struct mountd_exports_list *, const void *);
    350  1.92.2.2       riz 	int (*nsd_in)(struct nfsd_srvargs *, const void *);
    351  1.92.2.2       riz 	int (*nsd_out)(void *, const struct nfsd_srvargs *);
    352  1.92.2.2       riz 	int (*exp_in)(struct export_args *, const void *, size_t);
    353  1.92.2.2       riz };
    354  1.92.2.2       riz int do_nfssvc(struct nfssvc_copy_ops *, struct lwp *, int, void *, register_t *);
    355      1.52      jmmv 
    356      1.52      jmmv /* nfs_export.c */
    357      1.52      jmmv extern struct nfs_public nfs_pub;
    358      1.88  christos int mountd_set_exports_list(const struct mountd_exports_list *, struct lwp *,
    359      1.88  christos     struct mount *);
    360      1.54      yamt int netexport_check(const fsid_t *, struct mbuf *, struct mount **, int *,
    361      1.59      elad     kauth_cred_t *);
    362      1.58      yamt void netexport_rdlock(void);
    363      1.58      yamt void netexport_rdunlock(void);
    364      1.87        ad void netexport_init(void);
    365      1.87        ad void netexport_fini(void);
    366      1.91  christos bool netexport_hasexports(void);
    367      1.32      yamt #endif /* _KERNEL */
    368