xref: /netbsd-src/sys/fs/nfs/common/nfs_var.h (revision 0342d5080b4aa2e64ad6d1da61f9e3e072466754)
1*0342d508Spgoyette /*	$NetBSD: nfs_var.h,v 1.2 2016/12/13 22:52:46 pgoyette Exp $	*/
26ca35587Sdholland /*-
36ca35587Sdholland  * Copyright (c) 1989, 1993
46ca35587Sdholland  *	The Regents of the University of California.  All rights reserved.
56ca35587Sdholland  *
66ca35587Sdholland  * This code is derived from software contributed to Berkeley by
76ca35587Sdholland  * Rick Macklem at The University of Guelph.
86ca35587Sdholland  *
96ca35587Sdholland  * Redistribution and use in source and binary forms, with or without
106ca35587Sdholland  * modification, are permitted provided that the following conditions
116ca35587Sdholland  * are met:
126ca35587Sdholland  * 1. Redistributions of source code must retain the above copyright
136ca35587Sdholland  *    notice, this list of conditions and the following disclaimer.
146ca35587Sdholland  * 2. Redistributions in binary form must reproduce the above copyright
156ca35587Sdholland  *    notice, this list of conditions and the following disclaimer in the
166ca35587Sdholland  *    documentation and/or other materials provided with the distribution.
176ca35587Sdholland  * 4. Neither the name of the University nor the names of its contributors
186ca35587Sdholland  *    may be used to endorse or promote products derived from this software
196ca35587Sdholland  *    without specific prior written permission.
206ca35587Sdholland  *
216ca35587Sdholland  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
226ca35587Sdholland  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
236ca35587Sdholland  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
246ca35587Sdholland  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
256ca35587Sdholland  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
266ca35587Sdholland  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
276ca35587Sdholland  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
286ca35587Sdholland  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
296ca35587Sdholland  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
306ca35587Sdholland  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
316ca35587Sdholland  * SUCH DAMAGE.
326ca35587Sdholland  *
33e81f0ea2Spgoyette  * FreeBSD: head/sys/fs/nfs/nfs_var.h 294084 2016-01-15 09:05:14Z melifaro
34*0342d508Spgoyette  * $NetBSD: nfs_var.h,v 1.2 2016/12/13 22:52:46 pgoyette Exp $
356ca35587Sdholland  */
366ca35587Sdholland 
376ca35587Sdholland /*
386ca35587Sdholland  * XXX needs <nfs/rpcv2.h> and <nfs/nfs.h> because of typedefs
396ca35587Sdholland  */
406ca35587Sdholland 
416ca35587Sdholland struct uio;
42*0342d508Spgoyette struct kauth_cred;
436ca35587Sdholland struct nfscred;
446ca35587Sdholland NFSPROC_T;
456ca35587Sdholland struct buf;
466ca35587Sdholland struct sockaddr_in;
476ca35587Sdholland struct nfs_dlmount;
486ca35587Sdholland struct file;
496ca35587Sdholland struct nfsmount;
506ca35587Sdholland struct socket;
516ca35587Sdholland struct nfsreq;
526ca35587Sdholland struct nfssockreq;
536ca35587Sdholland struct vattr;
546ca35587Sdholland struct nameidata;
556ca35587Sdholland struct nfsnode;
566ca35587Sdholland struct nfsfh;
576ca35587Sdholland struct sillyrename;
586ca35587Sdholland struct componentname;
596ca35587Sdholland struct nfsd_srvargs;
606ca35587Sdholland struct nfsrv_descript;
616ca35587Sdholland struct nfs_fattr;
626ca35587Sdholland union nethostaddr;
636ca35587Sdholland struct nfsstate;
646ca35587Sdholland struct nfslock;
656ca35587Sdholland struct nfsclient;
66e81f0ea2Spgoyette struct nfsdsession;
676ca35587Sdholland struct nfslockconflict;
686ca35587Sdholland struct nfsd_idargs;
696ca35587Sdholland struct nfsd_clid;
706ca35587Sdholland struct nfsusrgrp;
716ca35587Sdholland struct nfsclowner;
726ca35587Sdholland struct nfsclopen;
736ca35587Sdholland struct nfsclopenhead;
746ca35587Sdholland struct nfsclclient;
756ca35587Sdholland struct nfsclsession;
766ca35587Sdholland struct nfscllockowner;
776ca35587Sdholland struct nfscllock;
786ca35587Sdholland struct nfscldeleg;
796ca35587Sdholland struct nfscllayout;
806ca35587Sdholland struct nfscldevinfo;
816ca35587Sdholland struct nfsv4lock;
826ca35587Sdholland struct nfsvattr;
836ca35587Sdholland struct nfs_vattr;
846ca35587Sdholland struct NFSSVCARGS;
856ca35587Sdholland #ifdef __FreeBSD__
866ca35587Sdholland NFS_ACCESS_ARGS;
876ca35587Sdholland NFS_OPEN_ARGS;
886ca35587Sdholland NFS_GETATTR_ARGS;
896ca35587Sdholland NFS_LOOKUP_ARGS;
906ca35587Sdholland NFS_READDIR_ARGS;
916ca35587Sdholland #endif
926ca35587Sdholland 
936ca35587Sdholland /* nfs_nfsdstate.c */
946ca35587Sdholland int nfsrv_setclient(struct nfsrv_descript *, struct nfsclient **,
956ca35587Sdholland     nfsquad_t *, nfsquad_t *, NFSPROC_T *);
96e81f0ea2Spgoyette int nfsrv_getclient(nfsquad_t, int, struct nfsclient **, struct nfsdsession *,
97e81f0ea2Spgoyette     nfsquad_t, uint32_t, struct nfsrv_descript *, NFSPROC_T *);
98e81f0ea2Spgoyette int nfsrv_destroyclient(nfsquad_t, NFSPROC_T *);
99e81f0ea2Spgoyette int nfsrv_destroysession(struct nfsrv_descript *, uint8_t *);
100e81f0ea2Spgoyette int nfsrv_freestateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *);
1016ca35587Sdholland int nfsrv_adminrevoke(struct nfsd_clid *, NFSPROC_T *);
1026ca35587Sdholland void nfsrv_dumpclients(struct nfsd_dumpclients *, int);
1036ca35587Sdholland void nfsrv_dumplocks(vnode_t, struct nfsd_dumplocks *, int, NFSPROC_T *);
1046ca35587Sdholland int nfsrv_lockctrl(vnode_t, struct nfsstate **,
1056ca35587Sdholland     struct nfslock **, struct nfslockconflict *, nfsquad_t, nfsv4stateid_t *,
1066ca35587Sdholland     struct nfsexstuff *, struct nfsrv_descript *, NFSPROC_T *);
1076ca35587Sdholland int nfsrv_openctrl(struct nfsrv_descript *, vnode_t,
1086ca35587Sdholland     struct nfsstate **, nfsquad_t, nfsv4stateid_t *, nfsv4stateid_t *,
1096ca35587Sdholland     u_int32_t *, struct nfsexstuff *, NFSPROC_T *, u_quad_t);
1106ca35587Sdholland int nfsrv_opencheck(nfsquad_t, nfsv4stateid_t *, struct nfsstate *,
1116ca35587Sdholland     vnode_t, struct nfsrv_descript *, NFSPROC_T *, int);
1126ca35587Sdholland int nfsrv_openupdate(vnode_t, struct nfsstate *, nfsquad_t,
1136ca35587Sdholland     nfsv4stateid_t *, struct nfsrv_descript *, NFSPROC_T *);
114e81f0ea2Spgoyette int nfsrv_delegupdate(struct nfsrv_descript *, nfsquad_t, nfsv4stateid_t *,
115*0342d508Spgoyette     vnode_t, int, struct kauth_cred *, NFSPROC_T *);
1166ca35587Sdholland int nfsrv_releaselckown(struct nfsstate *, nfsquad_t, NFSPROC_T *);
1176ca35587Sdholland void nfsrv_zapclient(struct nfsclient *, NFSPROC_T *);
1186ca35587Sdholland int nfssvc_idname(struct nfsd_idargs *);
1196ca35587Sdholland void nfsrv_servertimer(void);
1206ca35587Sdholland int nfsrv_getclientipaddr(struct nfsrv_descript *, struct nfsclient *);
1216ca35587Sdholland void nfsrv_setupstable(NFSPROC_T *);
1226ca35587Sdholland void nfsrv_updatestable(NFSPROC_T *);
1236ca35587Sdholland void nfsrv_writestable(u_char *, int, int, NFSPROC_T *);
1246ca35587Sdholland void nfsrv_throwawayopens(NFSPROC_T *);
1256ca35587Sdholland int nfsrv_checkremove(vnode_t, int, NFSPROC_T *);
1266ca35587Sdholland void nfsd_recalldelegation(vnode_t, NFSPROC_T *);
1276ca35587Sdholland void nfsd_disabledelegation(vnode_t, NFSPROC_T *);
1286ca35587Sdholland int nfsrv_checksetattr(vnode_t, struct nfsrv_descript *,
1296ca35587Sdholland     nfsv4stateid_t *, struct nfsvattr *, nfsattrbit_t *, struct nfsexstuff *,
1306ca35587Sdholland     NFSPROC_T *);
1316ca35587Sdholland int nfsrv_checkgetattr(struct nfsrv_descript *, vnode_t,
132*0342d508Spgoyette     struct nfsvattr *, nfsattrbit_t *, struct kauth_cred *, NFSPROC_T *);
1336ca35587Sdholland int nfsrv_nfsuserdport(u_short, NFSPROC_T *);
1346ca35587Sdholland void nfsrv_nfsuserddelport(void);
1356ca35587Sdholland void nfsrv_throwawayallstate(NFSPROC_T *);
136e81f0ea2Spgoyette int nfsrv_checksequence(struct nfsrv_descript *, uint32_t, uint32_t *,
137e81f0ea2Spgoyette     uint32_t *, int, uint32_t *, NFSPROC_T *);
138e81f0ea2Spgoyette int nfsrv_checkreclaimcomplete(struct nfsrv_descript *);
139e81f0ea2Spgoyette void nfsrv_cache_session(uint8_t *, uint32_t, int, struct mbuf **);
140e81f0ea2Spgoyette void nfsrv_freeallbackchannel_xprts(void);
1416ca35587Sdholland 
1426ca35587Sdholland /* nfs_nfsdserv.c */
1436ca35587Sdholland int nfsrvd_access(struct nfsrv_descript *, int,
1446ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1456ca35587Sdholland int nfsrvd_getattr(struct nfsrv_descript *, int,
1466ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1476ca35587Sdholland int nfsrvd_setattr(struct nfsrv_descript *, int,
1486ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1496ca35587Sdholland int nfsrvd_lookup(struct nfsrv_descript *, int,
1506ca35587Sdholland     vnode_t, vnode_t *, fhandle_t *, NFSPROC_T *,
1516ca35587Sdholland     struct nfsexstuff *);
1526ca35587Sdholland int nfsrvd_readlink(struct nfsrv_descript *, int,
1536ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1546ca35587Sdholland int nfsrvd_read(struct nfsrv_descript *, int,
1556ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1566ca35587Sdholland int nfsrvd_write(struct nfsrv_descript *, int,
1576ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1586ca35587Sdholland int nfsrvd_create(struct nfsrv_descript *, int,
1596ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1606ca35587Sdholland int nfsrvd_mknod(struct nfsrv_descript *, int,
1616ca35587Sdholland     vnode_t, vnode_t *, fhandle_t *, NFSPROC_T *,
1626ca35587Sdholland     struct nfsexstuff *);
1636ca35587Sdholland int nfsrvd_remove(struct nfsrv_descript *, int,
1646ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1656ca35587Sdholland int nfsrvd_rename(struct nfsrv_descript *, int,
1666ca35587Sdholland     vnode_t, vnode_t, NFSPROC_T *, struct nfsexstuff *,
1676ca35587Sdholland     struct nfsexstuff *);
1686ca35587Sdholland int nfsrvd_link(struct nfsrv_descript *, int,
1696ca35587Sdholland     vnode_t, vnode_t, NFSPROC_T *, struct nfsexstuff *,
1706ca35587Sdholland     struct nfsexstuff *);
1716ca35587Sdholland int nfsrvd_symlink(struct nfsrv_descript *, int,
1726ca35587Sdholland     vnode_t, vnode_t *, fhandle_t *, NFSPROC_T *,
1736ca35587Sdholland     struct nfsexstuff *);
1746ca35587Sdholland int nfsrvd_mkdir(struct nfsrv_descript *, int,
1756ca35587Sdholland     vnode_t, vnode_t *, fhandle_t *, NFSPROC_T *,
1766ca35587Sdholland     struct nfsexstuff *);
1776ca35587Sdholland int nfsrvd_readdir(struct nfsrv_descript *, int,
1786ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1796ca35587Sdholland int nfsrvd_readdirplus(struct nfsrv_descript *, int,
1806ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1816ca35587Sdholland int nfsrvd_commit(struct nfsrv_descript *, int,
1826ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1836ca35587Sdholland int nfsrvd_statfs(struct nfsrv_descript *, int,
1846ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1856ca35587Sdholland int nfsrvd_fsinfo(struct nfsrv_descript *, int,
1866ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1876ca35587Sdholland int nfsrvd_close(struct nfsrv_descript *, int,
1886ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1896ca35587Sdholland int nfsrvd_delegpurge(struct nfsrv_descript *, int,
1906ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1916ca35587Sdholland int nfsrvd_delegreturn(struct nfsrv_descript *, int,
1926ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1936ca35587Sdholland int nfsrvd_getfh(struct nfsrv_descript *, int,
1946ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1956ca35587Sdholland int nfsrvd_lock(struct nfsrv_descript *, int,
1966ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1976ca35587Sdholland int nfsrvd_lockt(struct nfsrv_descript *, int,
1986ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
1996ca35587Sdholland int nfsrvd_locku(struct nfsrv_descript *, int,
2006ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
2016ca35587Sdholland int nfsrvd_openconfirm(struct nfsrv_descript *, int,
2026ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
2036ca35587Sdholland int nfsrvd_opendowngrade(struct nfsrv_descript *, int,
2046ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
2056ca35587Sdholland int nfsrvd_renew(struct nfsrv_descript *, int,
2066ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
2076ca35587Sdholland int nfsrvd_secinfo(struct nfsrv_descript *, int,
2086ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
2096ca35587Sdholland int nfsrvd_setclientid(struct nfsrv_descript *, int,
2106ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
2116ca35587Sdholland int nfsrvd_setclientidcfrm(struct nfsrv_descript *, int,
2126ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
2136ca35587Sdholland int nfsrvd_verify(struct nfsrv_descript *, int,
2146ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
2156ca35587Sdholland int nfsrvd_open(struct nfsrv_descript *, int,
2166ca35587Sdholland     vnode_t, vnode_t *, fhandle_t *, NFSPROC_T *,
2176ca35587Sdholland     struct nfsexstuff *);
2186ca35587Sdholland int nfsrvd_openattr(struct nfsrv_descript *, int,
2196ca35587Sdholland     vnode_t, vnode_t *, fhandle_t *, NFSPROC_T *,
2206ca35587Sdholland     struct nfsexstuff *);
2216ca35587Sdholland int nfsrvd_releaselckown(struct nfsrv_descript *, int,
2226ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
2236ca35587Sdholland int nfsrvd_pathconf(struct nfsrv_descript *, int,
2246ca35587Sdholland     vnode_t, NFSPROC_T *, struct nfsexstuff *);
225e81f0ea2Spgoyette int nfsrvd_exchangeid(struct nfsrv_descript *, int,
226e81f0ea2Spgoyette     vnode_t, NFSPROC_T *, struct nfsexstuff *);
227e81f0ea2Spgoyette int nfsrvd_createsession(struct nfsrv_descript *, int,
228e81f0ea2Spgoyette     vnode_t, NFSPROC_T *, struct nfsexstuff *);
229e81f0ea2Spgoyette int nfsrvd_sequence(struct nfsrv_descript *, int,
230e81f0ea2Spgoyette     vnode_t, NFSPROC_T *, struct nfsexstuff *);
231e81f0ea2Spgoyette int nfsrvd_reclaimcomplete(struct nfsrv_descript *, int,
232e81f0ea2Spgoyette     vnode_t, NFSPROC_T *, struct nfsexstuff *);
233e81f0ea2Spgoyette int nfsrvd_destroyclientid(struct nfsrv_descript *, int,
234e81f0ea2Spgoyette     vnode_t, NFSPROC_T *, struct nfsexstuff *);
235e81f0ea2Spgoyette int nfsrvd_destroysession(struct nfsrv_descript *, int,
236e81f0ea2Spgoyette     vnode_t, NFSPROC_T *, struct nfsexstuff *);
237e81f0ea2Spgoyette int nfsrvd_freestateid(struct nfsrv_descript *, int,
238e81f0ea2Spgoyette     vnode_t, NFSPROC_T *, struct nfsexstuff *);
239e81f0ea2Spgoyette int nfsrvd_notsupp(struct nfsrv_descript *, int,
240e81f0ea2Spgoyette     vnode_t, NFSPROC_T *, struct nfsexstuff *);
2416ca35587Sdholland 
2426ca35587Sdholland /* nfs_nfsdsocket.c */
2436ca35587Sdholland void nfsrvd_rephead(struct nfsrv_descript *);
244e81f0ea2Spgoyette void nfsrvd_dorpc(struct nfsrv_descript *, int, u_char *, int, u_int32_t,
245e81f0ea2Spgoyette     NFSPROC_T *);
2466ca35587Sdholland 
2476ca35587Sdholland /* nfs_nfsdcache.c */
2486ca35587Sdholland void nfsrvd_initcache(void);
249e81f0ea2Spgoyette int nfsrvd_getcache(struct nfsrv_descript *);
250e81f0ea2Spgoyette struct nfsrvcache *nfsrvd_updatecache(struct nfsrv_descript *);
251e81f0ea2Spgoyette void nfsrvd_sentcache(struct nfsrvcache *, int, uint32_t);
2526ca35587Sdholland void nfsrvd_cleancache(void);
2536ca35587Sdholland void nfsrvd_refcache(struct nfsrvcache *);
2546ca35587Sdholland void nfsrvd_derefcache(struct nfsrvcache *);
2556ca35587Sdholland void nfsrvd_delcache(struct nfsrvcache *);
256e81f0ea2Spgoyette void nfsrc_trimcache(uint64_t, uint32_t, int);
2576ca35587Sdholland 
2586ca35587Sdholland /* nfs_commonsubs.c */
2596ca35587Sdholland void newnfs_init(void);
2606ca35587Sdholland int nfsaddr_match(int, union nethostaddr *, NFSSOCKADDR_T);
2616ca35587Sdholland int nfsaddr2_match(NFSSOCKADDR_T, NFSSOCKADDR_T);
2626ca35587Sdholland int nfsm_strtom(struct nfsrv_descript *, const char *, int);
2636ca35587Sdholland int nfsm_mbufuio(struct nfsrv_descript *, struct uio *, int);
2646ca35587Sdholland int nfsm_fhtom(struct nfsrv_descript *, u_int8_t *, int, int);
2656ca35587Sdholland int nfsm_advance(struct nfsrv_descript *, int, int);
2666ca35587Sdholland void *nfsm_dissct(struct nfsrv_descript *, int, int);
2676ca35587Sdholland void newnfs_trimleading(struct nfsrv_descript *);
268*0342d508Spgoyette void newnfs_trimtrailing(struct nfsrv_descript *, mbuf_t, char *);
269*0342d508Spgoyette void newnfs_copycred(struct nfscred *, struct kauth_cred *);
270*0342d508Spgoyette void newnfs_copyincred(struct kauth_cred *, struct nfscred *);
2716ca35587Sdholland int nfsrv_dissectacl(struct nfsrv_descript *, NFSACL_T *, int *,
2726ca35587Sdholland     int *, NFSPROC_T *);
2736ca35587Sdholland int nfsrv_getattrbits(struct nfsrv_descript *, nfsattrbit_t *, int *,
2746ca35587Sdholland     int *);
2756ca35587Sdholland int nfsv4_loadattr(struct nfsrv_descript *, vnode_t,
2766ca35587Sdholland     struct nfsvattr *, struct nfsfh **, fhandle_t *, int,
2776ca35587Sdholland     struct nfsv3_pathconf *, struct statfs *, struct nfsstatfs *,
2786ca35587Sdholland     struct nfsfsinfo *, NFSACL_T *,
279*0342d508Spgoyette     int, int *, u_int32_t *, u_int32_t *, NFSPROC_T *, struct kauth_cred *);
2806ca35587Sdholland int nfsv4_lock(struct nfsv4lock *, int, int *, void *, struct mount *);
2816ca35587Sdholland void nfsv4_unlock(struct nfsv4lock *, int);
2826ca35587Sdholland void nfsv4_relref(struct nfsv4lock *);
2836ca35587Sdholland void nfsv4_getref(struct nfsv4lock *, int *, void *, struct mount *);
2846ca35587Sdholland int nfsv4_getref_nonblock(struct nfsv4lock *);
2856ca35587Sdholland int nfsv4_testlock(struct nfsv4lock *);
2866ca35587Sdholland int nfsrv_mtostr(struct nfsrv_descript *, char *, int);
287e81f0ea2Spgoyette void nfsrv_cleanusergroup(void);
2886ca35587Sdholland int nfsrv_checkutf8(u_int8_t *, int);
2896ca35587Sdholland int newnfs_sndlock(int *);
2906ca35587Sdholland void newnfs_sndunlock(int *);
2916ca35587Sdholland int nfsv4_getipaddr(struct nfsrv_descript *, struct sockaddr_storage *,
2926ca35587Sdholland     int *);
2936ca35587Sdholland int nfsv4_seqsession(uint32_t, uint32_t, uint32_t, struct nfsslot *,
2946ca35587Sdholland     struct mbuf **, uint16_t);
295e81f0ea2Spgoyette void nfsv4_seqsess_cacherep(uint32_t, struct nfsslot *, int, struct mbuf **);
296e81f0ea2Spgoyette void nfsv4_setsequence(struct nfsmount *, struct nfsrv_descript *,
297e81f0ea2Spgoyette     struct nfsclsession *, int);
298e81f0ea2Spgoyette int nfsv4_sequencelookup(struct nfsmount *, struct nfsclsession *, int *,
299e81f0ea2Spgoyette     int *, uint32_t *, uint8_t *);
3006ca35587Sdholland void nfsv4_freeslot(struct nfsclsession *, int);
301*0342d508Spgoyette struct kauth_cred *nfsrv_getgrpscred(struct kauth_cred *);
3026ca35587Sdholland 
3036ca35587Sdholland /* nfs_clcomsubs.c */
3046ca35587Sdholland void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int);
3056ca35587Sdholland void nfscl_reqstart(struct nfsrv_descript *, int, struct nfsmount *,
3066ca35587Sdholland     u_int8_t *, int, u_int32_t **, struct nfsclsession *);
3076ca35587Sdholland nfsuint64 *nfscl_getcookie(struct nfsnode *, off_t off, int);
3086ca35587Sdholland void nfscl_fillsattr(struct nfsrv_descript *, struct vattr *,
3096ca35587Sdholland       vnode_t, int, u_int32_t);
310e81f0ea2Spgoyette u_int8_t *nfscl_getmyip(struct nfsmount *, struct in6_addr *, int *);
3116ca35587Sdholland int nfsm_getfh(struct nfsrv_descript *, struct nfsfh **);
3126ca35587Sdholland int nfscl_mtofh(struct nfsrv_descript *, struct nfsfh **,
3136ca35587Sdholland         struct nfsvattr *, int *);
3146ca35587Sdholland int nfscl_postop_attr(struct nfsrv_descript *, struct nfsvattr *, int *,
3156ca35587Sdholland     void *);
3166ca35587Sdholland int nfscl_wcc_data(struct nfsrv_descript *, vnode_t,
3176ca35587Sdholland     struct nfsvattr *, int *, int *, void *);
3186ca35587Sdholland int nfsm_loadattr(struct nfsrv_descript *, struct nfsvattr *);
3196ca35587Sdholland int nfscl_request(struct nfsrv_descript *, vnode_t,
320*0342d508Spgoyette          NFSPROC_T *, struct kauth_cred *, void *);
3216ca35587Sdholland void nfsm_stateidtom(struct nfsrv_descript *, nfsv4stateid_t *, int);
3226ca35587Sdholland 
3236ca35587Sdholland /* nfs_nfsdsubs.c */
3246ca35587Sdholland void nfsd_fhtovp(struct nfsrv_descript *, struct nfsrvfh *, int,
3256ca35587Sdholland     vnode_t *, struct nfsexstuff *,
3266ca35587Sdholland     mount_t *, int, NFSPROC_T *);
327*0342d508Spgoyette int nfsd_excred(struct nfsrv_descript *, struct nfsexstuff *, struct kauth_cred *);
3286ca35587Sdholland int nfsrv_mtofh(struct nfsrv_descript *, struct nfsrvfh *);
3296ca35587Sdholland int nfsrv_putattrbit(struct nfsrv_descript *, nfsattrbit_t *);
3306ca35587Sdholland void nfsrv_wcc(struct nfsrv_descript *, int, struct nfsvattr *, int,
3316ca35587Sdholland     struct nfsvattr *);
3326ca35587Sdholland int nfsv4_fillattr(struct nfsrv_descript *, struct mount *, vnode_t, NFSACL_T *,
3336ca35587Sdholland     struct vattr *, fhandle_t *, int, nfsattrbit_t *,
334*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, int, int, int, int, uint64_t);
3356ca35587Sdholland void nfsrv_fillattr(struct nfsrv_descript *, struct nfsvattr *);
3366ca35587Sdholland void nfsrv_adj(mbuf_t, int, int);
3376ca35587Sdholland void nfsrv_postopattr(struct nfsrv_descript *, int, struct nfsvattr *);
3386ca35587Sdholland int nfsd_errmap(struct nfsrv_descript *);
3396ca35587Sdholland void nfsv4_uidtostr(uid_t, u_char **, int *, NFSPROC_T *);
3406ca35587Sdholland int nfsv4_strtouid(struct nfsrv_descript *, u_char *, int, uid_t *,
3416ca35587Sdholland     NFSPROC_T *);
3426ca35587Sdholland void nfsv4_gidtostr(gid_t, u_char **, int *, NFSPROC_T *);
3436ca35587Sdholland int nfsv4_strtogid(struct nfsrv_descript *, u_char *, int, gid_t *,
3446ca35587Sdholland     NFSPROC_T *);
3456ca35587Sdholland int nfsrv_checkuidgid(struct nfsrv_descript *, struct nfsvattr *);
3466ca35587Sdholland void nfsrv_fixattr(struct nfsrv_descript *, vnode_t,
3476ca35587Sdholland     struct nfsvattr *, NFSACL_T *, NFSPROC_T *, nfsattrbit_t *,
3486ca35587Sdholland     struct nfsexstuff *);
3496ca35587Sdholland int nfsrv_errmoved(int);
3506ca35587Sdholland int nfsrv_putreferralattr(struct nfsrv_descript *, nfsattrbit_t *,
3516ca35587Sdholland     struct nfsreferral *, int, int *);
3526ca35587Sdholland int nfsrv_parsename(struct nfsrv_descript *, char *, u_long *,
3536ca35587Sdholland     NFSPATHLEN_T *);
3546ca35587Sdholland void nfsd_init(void);
3556ca35587Sdholland int nfsd_checkrootexp(struct nfsrv_descript *);
356e81f0ea2Spgoyette void nfsd_getminorvers(struct nfsrv_descript *, u_char *, u_char **, int *,
357e81f0ea2Spgoyette     u_int32_t *);
3586ca35587Sdholland 
3596ca35587Sdholland /* nfs_clvfsops.c */
3606ca35587Sdholland void nfscl_retopts(struct nfsmount *, char *, size_t);
3616ca35587Sdholland 
3626ca35587Sdholland /* nfs_commonport.c */
3636ca35587Sdholland int nfsrv_lookupfilename(struct nameidata *, char *, NFSPROC_T *);
3646ca35587Sdholland void nfsrv_object_create(vnode_t, NFSPROC_T *);
3656ca35587Sdholland int nfsrv_mallocmget_limit(void);
3666ca35587Sdholland int nfsvno_v4rootexport(struct nfsrv_descript *);
3676ca35587Sdholland void newnfs_portinit(void);
368*0342d508Spgoyette struct kauth_cred *newnfs_getcred(void);
369*0342d508Spgoyette void newnfs_setroot(struct kauth_cred *);
3706ca35587Sdholland int nfs_catnap(int, int, const char *);
3716ca35587Sdholland struct nfsreferral *nfsv4root_getreferral(vnode_t, vnode_t, u_int32_t);
372*0342d508Spgoyette int nfsvno_pathconf(vnode_t, int, register_t *, struct kauth_cred *,
3736ca35587Sdholland     NFSPROC_T *);
3746ca35587Sdholland int nfsrv_atroot(vnode_t, long *);
3756ca35587Sdholland void newnfs_timer(void *);
3766ca35587Sdholland int nfs_supportsnfsv4acls(vnode_t);
3776ca35587Sdholland 
3786ca35587Sdholland /* nfs_commonacl.c */
3796ca35587Sdholland int nfsrv_dissectace(struct nfsrv_descript *, struct acl_entry *,
3806ca35587Sdholland     int *, int *, NFSPROC_T *);
3816ca35587Sdholland int nfsrv_buildacl(struct nfsrv_descript *, NFSACL_T *, enum vtype,
3826ca35587Sdholland     NFSPROC_T *);
383*0342d508Spgoyette int nfsrv_setacl(vnode_t, NFSACL_T *, struct kauth_cred *,
3846ca35587Sdholland     NFSPROC_T *);
3856ca35587Sdholland int nfsrv_compareacl(NFSACL_T *, NFSACL_T *);
3866ca35587Sdholland 
3876ca35587Sdholland /* nfs_clrpcops.c */
388*0342d508Spgoyette int nfsrpc_null(vnode_t, struct kauth_cred *, NFSPROC_T *);
389*0342d508Spgoyette int nfsrpc_access(vnode_t, int, struct kauth_cred *, NFSPROC_T *,
3906ca35587Sdholland     struct nfsvattr *, int *);
391*0342d508Spgoyette int nfsrpc_accessrpc(vnode_t, u_int32_t, struct kauth_cred *,
3926ca35587Sdholland     NFSPROC_T *, struct nfsvattr *, int *, u_int32_t *, void *);
393*0342d508Spgoyette int nfsrpc_open(vnode_t, int, struct kauth_cred *, NFSPROC_T *);
3946ca35587Sdholland int nfsrpc_openrpc(struct nfsmount *, vnode_t, u_int8_t *, int, u_int8_t *, int,
3956ca35587Sdholland     u_int32_t, struct nfsclopen *, u_int8_t *, int, struct nfscldeleg **, int,
396*0342d508Spgoyette     u_int32_t, struct kauth_cred *, NFSPROC_T *, int, int);
3976ca35587Sdholland int nfsrpc_opendowngrade(vnode_t, u_int32_t, struct nfsclopen *,
398*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *);
3996ca35587Sdholland int nfsrpc_close(vnode_t, int, NFSPROC_T *);
4006ca35587Sdholland int nfsrpc_closerpc(struct nfsrv_descript *, struct nfsmount *,
401*0342d508Spgoyette     struct nfsclopen *, struct kauth_cred *, NFSPROC_T *, int);
4026ca35587Sdholland int nfsrpc_openconfirm(vnode_t, u_int8_t *, int, struct nfsclopen *,
403*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *);
4046ca35587Sdholland int nfsrpc_setclient(struct nfsmount *, struct nfsclclient *, int,
405*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *);
406*0342d508Spgoyette int nfsrpc_getattr(vnode_t, struct kauth_cred *, NFSPROC_T *,
4076ca35587Sdholland     struct nfsvattr *, void *);
4086ca35587Sdholland int nfsrpc_getattrnovp(struct nfsmount *, u_int8_t *, int, int,
409*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, struct nfsvattr *, u_int64_t *, uint32_t *);
410*0342d508Spgoyette int nfsrpc_setattr(vnode_t, struct vattr *, NFSACL_T *, struct kauth_cred *,
4116ca35587Sdholland     NFSPROC_T *, struct nfsvattr *, int *, void *);
412*0342d508Spgoyette int nfsrpc_lookup(vnode_t, char *, int, struct kauth_cred *, NFSPROC_T *,
4136ca35587Sdholland     struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *,
4146ca35587Sdholland     void *);
415*0342d508Spgoyette int nfsrpc_readlink(vnode_t, struct uio *, struct kauth_cred *,
4166ca35587Sdholland     NFSPROC_T *, struct nfsvattr *, int *, void *);
417*0342d508Spgoyette int nfsrpc_read(vnode_t, struct uio *, struct kauth_cred *, NFSPROC_T *,
4186ca35587Sdholland     struct nfsvattr *, int *, void *);
4196ca35587Sdholland int nfsrpc_write(vnode_t, struct uio *, int *, int *,
420*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, struct nfsvattr *, int *, void *, int);
4216ca35587Sdholland int nfsrpc_mknod(vnode_t, char *, int, struct vattr *, u_int32_t,
422*0342d508Spgoyette     enum vtype, struct kauth_cred *, NFSPROC_T *, struct nfsvattr *,
4236ca35587Sdholland     struct nfsvattr *, struct nfsfh **, int *, int *, void *);
4246ca35587Sdholland int nfsrpc_create(vnode_t, char *, int, struct vattr *, nfsquad_t,
425*0342d508Spgoyette     int, struct kauth_cred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *,
4266ca35587Sdholland     struct nfsfh **, int *, int *, void *);
427*0342d508Spgoyette int nfsrpc_remove(vnode_t, char *, int, vnode_t, struct kauth_cred *, NFSPROC_T *,
4286ca35587Sdholland     struct nfsvattr *, int *, void *);
4296ca35587Sdholland int nfsrpc_rename(vnode_t, vnode_t, char *, int, vnode_t, vnode_t, char *, int,
430*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *,
4316ca35587Sdholland     int *, int *, void *, void *);
4326ca35587Sdholland int nfsrpc_link(vnode_t, vnode_t, char *, int,
433*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *,
4346ca35587Sdholland     int *, int *, void *);
4356ca35587Sdholland int nfsrpc_symlink(vnode_t, char *, int, char *, struct vattr *,
436*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *,
4376ca35587Sdholland     struct nfsfh **, int *, int *, void *);
4386ca35587Sdholland int nfsrpc_mkdir(vnode_t, char *, int, struct vattr *,
439*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *,
4406ca35587Sdholland     struct nfsfh **, int *, int *, void *);
441*0342d508Spgoyette int nfsrpc_rmdir(vnode_t, char *, int, struct kauth_cred *, NFSPROC_T *,
4426ca35587Sdholland     struct nfsvattr *, int *, void *);
443*0342d508Spgoyette int nfsrpc_readdir(vnode_t, struct uio *, nfsuint64 *, struct kauth_cred *,
4446ca35587Sdholland     NFSPROC_T *, struct nfsvattr *, int *, int *, void *);
4456ca35587Sdholland int nfsrpc_readdirplus(vnode_t, struct uio *, nfsuint64 *,
446*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, struct nfsvattr *, int *, int *, void *);
447*0342d508Spgoyette int nfsrpc_commit(vnode_t, u_quad_t, int, struct kauth_cred *,
4486ca35587Sdholland     NFSPROC_T *, struct nfsvattr *, int *, void *);
4496ca35587Sdholland int nfsrpc_advlock(vnode_t, off_t, int, struct flock *, int,
450*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, void *, int);
4516ca35587Sdholland int nfsrpc_lockt(struct nfsrv_descript *, vnode_t,
4526ca35587Sdholland     struct nfsclclient *, u_int64_t, u_int64_t, struct flock *,
453*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, void *, int);
4546ca35587Sdholland int nfsrpc_lock(struct nfsrv_descript *, struct nfsmount *, vnode_t,
4556ca35587Sdholland     u_int8_t *, int, struct nfscllockowner *, int, int, u_int64_t,
456*0342d508Spgoyette     u_int64_t, short, struct kauth_cred *, NFSPROC_T *, int);
4576ca35587Sdholland int nfsrpc_statfs(vnode_t, struct nfsstatfs *, struct nfsfsinfo *,
458*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, struct nfsvattr *, int *, void *);
459*0342d508Spgoyette int nfsrpc_fsinfo(vnode_t, struct nfsfsinfo *, struct kauth_cred *,
4606ca35587Sdholland     NFSPROC_T *, struct nfsvattr *, int *, void *);
4616ca35587Sdholland int nfsrpc_pathconf(vnode_t, struct nfsv3_pathconf *,
462*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, struct nfsvattr *, int *, void *);
463*0342d508Spgoyette int nfsrpc_renew(struct nfsclclient *, struct nfsclds *, struct kauth_cred *,
4646ca35587Sdholland     NFSPROC_T *);
4656ca35587Sdholland int nfsrpc_rellockown(struct nfsmount *, struct nfscllockowner *, uint8_t *,
466*0342d508Spgoyette     int, struct kauth_cred *, NFSPROC_T *);
467*0342d508Spgoyette int nfsrpc_getdirpath(struct nfsmount *, u_char *, struct kauth_cred *,
4686ca35587Sdholland     NFSPROC_T *);
469*0342d508Spgoyette int nfsrpc_delegreturn(struct nfscldeleg *, struct kauth_cred *,
4706ca35587Sdholland     struct nfsmount *, NFSPROC_T *, int);
471*0342d508Spgoyette int nfsrpc_getacl(vnode_t, struct kauth_cred *, NFSPROC_T *, NFSACL_T *, void *);
472*0342d508Spgoyette int nfsrpc_setacl(vnode_t, struct kauth_cred *, NFSPROC_T *, NFSACL_T *, void *);
4736ca35587Sdholland int nfsrpc_exchangeid(struct nfsmount *, struct nfsclclient *,
474*0342d508Spgoyette     struct nfssockreq *, uint32_t, struct nfsclds **, struct kauth_cred *,
4756ca35587Sdholland     NFSPROC_T *);
4766ca35587Sdholland int nfsrpc_createsession(struct nfsmount *, struct nfsclsession *,
477*0342d508Spgoyette     struct nfssockreq *, uint32_t, int, struct kauth_cred *, NFSPROC_T *);
4786ca35587Sdholland int nfsrpc_destroysession(struct nfsmount *, struct nfsclclient *,
479*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *);
4806ca35587Sdholland int nfsrpc_destroyclient(struct nfsmount *, struct nfsclclient *,
481*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *);
4826ca35587Sdholland int nfsrpc_layoutget(struct nfsmount *, uint8_t *, int, int, uint64_t, uint64_t,
4836ca35587Sdholland     uint64_t, int, nfsv4stateid_t *, int *, struct nfsclflayouthead *,
484*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, void *);
4856ca35587Sdholland int nfsrpc_getdeviceinfo(struct nfsmount *, uint8_t *, int, uint32_t *,
486*0342d508Spgoyette     struct nfscldevinfo **, struct kauth_cred *, NFSPROC_T *);
4876ca35587Sdholland int nfsrpc_layoutcommit(struct nfsmount *, uint8_t *, int, int,
4886ca35587Sdholland     uint64_t, uint64_t, uint64_t, nfsv4stateid_t *, int, int, uint8_t *,
489*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, void *);
4906ca35587Sdholland int nfsrpc_layoutreturn(struct nfsmount *, uint8_t *, int, int, int, uint32_t,
491*0342d508Spgoyette     int, uint64_t, uint64_t, nfsv4stateid_t *, int, uint32_t *, struct kauth_cred *,
4926ca35587Sdholland     NFSPROC_T *, void *);
493*0342d508Spgoyette int nfsrpc_reclaimcomplete(struct nfsmount *, struct kauth_cred *, NFSPROC_T *);
4946ca35587Sdholland int nfscl_doiods(vnode_t, struct uio *, int *, int *, uint32_t,
495*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *);
4966ca35587Sdholland int nfscl_findlayoutforio(struct nfscllayout *, uint64_t, uint32_t,
4976ca35587Sdholland     struct nfsclflayout **);
4986ca35587Sdholland void nfscl_freenfsclds(struct nfsclds *);
4996ca35587Sdholland 
5006ca35587Sdholland /* nfs_clstate.c */
5016ca35587Sdholland int nfscl_open(vnode_t, u_int8_t *, int, u_int32_t, int,
502*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, struct nfsclowner **, struct nfsclopen **,
5036ca35587Sdholland     int *, int *, int);
504*0342d508Spgoyette int nfscl_getstateid(vnode_t, u_int8_t *, int, u_int32_t, int, struct kauth_cred *,
5056ca35587Sdholland     NFSPROC_T *, nfsv4stateid_t *, void **);
5066ca35587Sdholland void nfscl_ownerrelease(struct nfsclowner *, int, int, int);
5076ca35587Sdholland void nfscl_openrelease(struct nfsclopen *, int, int);
508*0342d508Spgoyette int nfscl_getcl(struct mount *, struct kauth_cred *, NFSPROC_T *, int,
5096ca35587Sdholland     struct nfsclclient **);
5106ca35587Sdholland struct nfsclclient *nfscl_findcl(struct nfsmount *);
5116ca35587Sdholland void nfscl_clientrelease(struct nfsclclient *);
5126ca35587Sdholland void nfscl_freelock(struct nfscllock *, int);
5136ca35587Sdholland void nfscl_freelockowner(struct nfscllockowner *, int);
5146ca35587Sdholland int nfscl_getbytelock(vnode_t, u_int64_t, u_int64_t, short,
515*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, struct nfsclclient *, int, void *, int,
5166ca35587Sdholland     u_int8_t *, u_int8_t *, struct nfscllockowner **, int *, int *);
5176ca35587Sdholland int nfscl_relbytelock(vnode_t, u_int64_t, u_int64_t,
518*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, int, struct nfsclclient *,
5196ca35587Sdholland     void *, int, struct nfscllockowner **, int *);
5206ca35587Sdholland int nfscl_checkwritelocked(vnode_t, struct flock *,
521*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, void *, int);
5226ca35587Sdholland void nfscl_lockrelease(struct nfscllockowner *, int, int);
5236ca35587Sdholland void nfscl_fillclid(u_int64_t, char *, u_int8_t *, u_int16_t);
5246ca35587Sdholland void nfscl_filllockowner(void *, u_int8_t *, int);
5256ca35587Sdholland void nfscl_freeopen(struct nfsclopen *, int);
5266ca35587Sdholland void nfscl_umount(struct nfsmount *, NFSPROC_T *);
5276ca35587Sdholland void nfscl_renewthread(struct nfsclclient *, NFSPROC_T *);
5286ca35587Sdholland void nfscl_initiate_recovery(struct nfsclclient *);
5296ca35587Sdholland int nfscl_hasexpired(struct nfsclclient *, u_int32_t, NFSPROC_T *);
5306ca35587Sdholland void nfscl_dumpstate(struct nfsmount *, int, int, int, int);
5316ca35587Sdholland void nfscl_dupopen(vnode_t, int);
5326ca35587Sdholland int nfscl_getclose(vnode_t, struct nfsclclient **);
5336ca35587Sdholland int nfscl_doclose(vnode_t, struct nfsclclient **, NFSPROC_T *);
5346ca35587Sdholland void nfsrpc_doclose(struct nfsmount *, struct nfsclopen *, NFSPROC_T *);
5356ca35587Sdholland int nfscl_deleg(mount_t, struct nfsclclient *, u_int8_t *, int,
536*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, struct nfscldeleg **);
5376ca35587Sdholland void nfscl_lockinit(struct nfsv4lock *);
5386ca35587Sdholland void nfscl_lockexcl(struct nfsv4lock *, void *);
5396ca35587Sdholland void nfscl_lockunlock(struct nfsv4lock *);
5406ca35587Sdholland void nfscl_lockderef(struct nfsv4lock *);
5416ca35587Sdholland void nfscl_docb(struct nfsrv_descript *, NFSPROC_T *);
5426ca35587Sdholland void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *, void *,
5436ca35587Sdholland     int);
5446ca35587Sdholland int nfscl_lockt(vnode_t, struct nfsclclient *, u_int64_t,
5456ca35587Sdholland     u_int64_t, struct flock *, NFSPROC_T *, void *, int);
5466ca35587Sdholland int nfscl_mustflush(vnode_t);
5476ca35587Sdholland int nfscl_nodeleg(vnode_t, int);
5486ca35587Sdholland int nfscl_removedeleg(vnode_t, NFSPROC_T *, nfsv4stateid_t *);
5496ca35587Sdholland int nfscl_getref(struct nfsmount *);
5506ca35587Sdholland void nfscl_relref(struct nfsmount *);
5516ca35587Sdholland int nfscl_renamedeleg(vnode_t, nfsv4stateid_t *, int *, vnode_t,
5526ca35587Sdholland     nfsv4stateid_t *, int *, NFSPROC_T *);
5536ca35587Sdholland void nfscl_reclaimnode(vnode_t);
5546ca35587Sdholland void nfscl_newnode(vnode_t);
5556ca35587Sdholland void nfscl_delegmodtime(vnode_t);
5566ca35587Sdholland void nfscl_deleggetmodtime(vnode_t, struct timespec *);
557*0342d508Spgoyette int nfscl_tryclose(struct nfsclopen *, struct kauth_cred *,
5586ca35587Sdholland     struct nfsmount *, NFSPROC_T *);
5596ca35587Sdholland void nfscl_cleanup(NFSPROC_T *);
5606ca35587Sdholland int nfscl_layout(struct nfsmount *, vnode_t, u_int8_t *, int, nfsv4stateid_t *,
561*0342d508Spgoyette     int, struct nfsclflayouthead *, struct nfscllayout **, struct kauth_cred *,
5626ca35587Sdholland     NFSPROC_T *);
5636ca35587Sdholland struct nfscllayout *nfscl_getlayout(struct nfsclclient *, uint8_t *, int,
5646ca35587Sdholland     uint64_t, struct nfsclflayout **, int *);
5656ca35587Sdholland void nfscl_rellayout(struct nfscllayout *, int);
5666ca35587Sdholland struct nfscldevinfo *nfscl_getdevinfo(struct nfsclclient *, uint8_t *,
5676ca35587Sdholland     struct nfscldevinfo *);
5686ca35587Sdholland void nfscl_reldevinfo(struct nfscldevinfo *);
5696ca35587Sdholland int nfscl_adddevinfo(struct nfsmount *, struct nfscldevinfo *,
5706ca35587Sdholland     struct nfsclflayout *);
5716ca35587Sdholland void nfscl_freelayout(struct nfscllayout *);
5726ca35587Sdholland void nfscl_freeflayout(struct nfsclflayout *);
5736ca35587Sdholland void nfscl_freedevinfo(struct nfscldevinfo *);
5746ca35587Sdholland int nfscl_layoutcommit(vnode_t, NFSPROC_T *);
5756ca35587Sdholland 
5766ca35587Sdholland /* nfs_clport.c */
5776ca35587Sdholland int nfscl_nget(mount_t, vnode_t, struct nfsfh *,
5786ca35587Sdholland     struct componentname *, NFSPROC_T *, struct nfsnode **, void *, int);
5796ca35587Sdholland NFSPROC_T *nfscl_getparent(NFSPROC_T *);
5806ca35587Sdholland void nfscl_start_renewthread(struct nfsclclient *);
5816ca35587Sdholland void nfscl_loadsbinfo(struct nfsmount *, struct nfsstatfs *, void *);
5826ca35587Sdholland void nfscl_loadfsinfo (struct nfsmount *, struct nfsfsinfo *);
5836ca35587Sdholland void nfscl_delegreturn(struct nfscldeleg *, int, struct nfsmount *,
584*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *);
5856ca35587Sdholland void nfsrvd_cbinit(int);
5866ca35587Sdholland int nfscl_checksattr(struct vattr *, struct nfsvattr *);
5876ca35587Sdholland int nfscl_ngetreopen(mount_t, u_int8_t *, int, NFSPROC_T *,
5886ca35587Sdholland     struct nfsnode **);
5896ca35587Sdholland int nfscl_procdoesntexist(u_int8_t *);
5906ca35587Sdholland int nfscl_maperr(NFSPROC_T *, int, uid_t, gid_t);
5916ca35587Sdholland 
5926ca35587Sdholland /* nfs_clsubs.c */
5936ca35587Sdholland void nfscl_init(void);
5946ca35587Sdholland 
5956ca35587Sdholland /* nfs_clbio.c */
596*0342d508Spgoyette int ncl_flush(vnode_t, int, struct kauth_cred *, NFSPROC_T *, int, int);
5976ca35587Sdholland 
5986ca35587Sdholland /* nfs_clnode.c */
5996ca35587Sdholland void ncl_invalcaches(vnode_t);
6006ca35587Sdholland 
6016ca35587Sdholland /* nfs_nfsdport.c */
602*0342d508Spgoyette int nfsvno_getattr(vnode_t, struct nfsvattr *, struct kauth_cred *,
6036ca35587Sdholland     NFSPROC_T *, int);
604*0342d508Spgoyette int nfsvno_setattr(vnode_t, struct nfsvattr *, struct kauth_cred *,
6056ca35587Sdholland     NFSPROC_T *, struct nfsexstuff *);
6066ca35587Sdholland int nfsvno_getfh(vnode_t, fhandle_t *, NFSPROC_T *);
607*0342d508Spgoyette int nfsvno_accchk(vnode_t, accmode_t, struct kauth_cred *,
6086ca35587Sdholland     struct nfsexstuff *, NFSPROC_T *, int, int, u_int32_t *);
6096ca35587Sdholland int nfsvno_namei(struct nfsrv_descript *, struct nameidata *,
6106ca35587Sdholland     vnode_t, int, struct nfsexstuff *, NFSPROC_T *, vnode_t *);
6116ca35587Sdholland void nfsvno_setpathbuf(struct nameidata *, char **, u_long **);
6126ca35587Sdholland void nfsvno_relpathbuf(struct nameidata *);
613*0342d508Spgoyette int nfsvno_readlink(vnode_t, struct kauth_cred *, NFSPROC_T *, mbuf_t *,
6146ca35587Sdholland     mbuf_t *, int *);
615*0342d508Spgoyette int nfsvno_read(vnode_t, off_t, int, struct kauth_cred *, NFSPROC_T *,
6166ca35587Sdholland     mbuf_t *, mbuf_t *);
6176ca35587Sdholland int nfsvno_write(vnode_t, off_t, int, int, int, mbuf_t,
618*0342d508Spgoyette     char *, struct kauth_cred *, NFSPROC_T *);
6196ca35587Sdholland int nfsvno_createsub(struct nfsrv_descript *, struct nameidata *,
6206ca35587Sdholland     vnode_t *, struct nfsvattr *, int *, int32_t *, NFSDEV_T, NFSPROC_T *,
6216ca35587Sdholland     struct nfsexstuff *);
622*0342d508Spgoyette int nfsvno_mknod(struct nameidata *, struct nfsvattr *, struct kauth_cred *,
6236ca35587Sdholland     NFSPROC_T *);
6246ca35587Sdholland int nfsvno_mkdir(struct nameidata *,
625*0342d508Spgoyette     struct nfsvattr *, uid_t, struct kauth_cred *, NFSPROC_T *,
6266ca35587Sdholland     struct nfsexstuff *);
6276ca35587Sdholland int nfsvno_symlink(struct nameidata *, struct nfsvattr *, char *, int, int,
628*0342d508Spgoyette     uid_t, struct kauth_cred *, NFSPROC_T *, struct nfsexstuff *);
6296ca35587Sdholland int nfsvno_getsymlink(struct nfsrv_descript *, struct nfsvattr *,
6306ca35587Sdholland     NFSPROC_T *, char **, int *);
631*0342d508Spgoyette int nfsvno_removesub(struct nameidata *, int, struct kauth_cred *, NFSPROC_T *,
6326ca35587Sdholland     struct nfsexstuff *);
633*0342d508Spgoyette int nfsvno_rmdirsub(struct nameidata *, int, struct kauth_cred *, NFSPROC_T *,
6346ca35587Sdholland     struct nfsexstuff *);
6356ca35587Sdholland int nfsvno_rename(struct nameidata *, struct nameidata *, u_int32_t,
636*0342d508Spgoyette     u_int32_t, struct kauth_cred *, NFSPROC_T *);
637*0342d508Spgoyette int nfsvno_link(struct nameidata *, vnode_t, struct kauth_cred *,
6386ca35587Sdholland     NFSPROC_T *, struct nfsexstuff *);
639*0342d508Spgoyette int nfsvno_fsync(vnode_t, u_int64_t, int, struct kauth_cred *, NFSPROC_T *);
6406ca35587Sdholland int nfsvno_statfs(vnode_t, struct statfs *);
6416ca35587Sdholland void nfsvno_getfs(struct nfsfsinfo *, int);
6426ca35587Sdholland void nfsvno_open(struct nfsrv_descript *, struct nameidata *, nfsquad_t,
6436ca35587Sdholland     nfsv4stateid_t *, struct nfsstate *, int *, struct nfsvattr *, int32_t *,
644*0342d508Spgoyette     int, NFSACL_T *, nfsattrbit_t *, struct kauth_cred *, NFSPROC_T *,
6456ca35587Sdholland     struct nfsexstuff *, vnode_t *);
646*0342d508Spgoyette int nfsvno_updfilerev(vnode_t, struct nfsvattr *, struct kauth_cred *,
6476ca35587Sdholland     NFSPROC_T *);
6486ca35587Sdholland int nfsvno_fillattr(struct nfsrv_descript *, struct mount *, vnode_t,
6496ca35587Sdholland     struct nfsvattr *, fhandle_t *, int, nfsattrbit_t *,
650*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, int, int, int, int, uint64_t);
651e81f0ea2Spgoyette int nfsrv_sattr(struct nfsrv_descript *, vnode_t, struct nfsvattr *, nfsattrbit_t *,
6526ca35587Sdholland     NFSACL_T *, NFSPROC_T *);
653e81f0ea2Spgoyette int nfsv4_sattr(struct nfsrv_descript *, vnode_t, struct nfsvattr *, nfsattrbit_t *,
6546ca35587Sdholland     NFSACL_T *, NFSPROC_T *);
6556ca35587Sdholland int nfsvno_checkexp(mount_t, NFSSOCKADDR_T, struct nfsexstuff *,
656*0342d508Spgoyette     struct kauth_cred **);
6576ca35587Sdholland int nfsvno_fhtovp(mount_t, fhandle_t *, NFSSOCKADDR_T, int,
658*0342d508Spgoyette     vnode_t *, struct nfsexstuff *, struct kauth_cred **);
6596ca35587Sdholland vnode_t nfsvno_getvp(fhandle_t *);
6606ca35587Sdholland int nfsvno_advlock(vnode_t, int, u_int64_t, u_int64_t, NFSPROC_T *);
661*0342d508Spgoyette int nfsrv_v4rootexport(void *, struct kauth_cred *, NFSPROC_T *);
6626ca35587Sdholland int nfsvno_testexp(struct nfsrv_descript *, struct nfsexstuff *);
6636ca35587Sdholland uint32_t nfsrv_hashfh(fhandle_t *);
664e81f0ea2Spgoyette uint32_t nfsrv_hashsessionid(uint8_t *);
6656ca35587Sdholland void nfsrv_backupstable(void);
6666ca35587Sdholland 
6676ca35587Sdholland /* nfs_commonkrpc.c */
6686ca35587Sdholland int newnfs_nmcancelreqs(struct nfsmount *);
669*0342d508Spgoyette void newnfs_set_sigmask(struct lwp *, sigset_t *);
670*0342d508Spgoyette void newnfs_restore_sigmask(struct lwp *, sigset_t *);
671*0342d508Spgoyette int newnfs_msleep(struct lwp *, void *, struct kmutex *, int, char *, int);
6726ca35587Sdholland int newnfs_request(struct nfsrv_descript *, struct nfsmount *,
6736ca35587Sdholland     struct nfsclient *, struct nfssockreq *, vnode_t, NFSPROC_T *,
674*0342d508Spgoyette     struct kauth_cred *, u_int32_t, u_int32_t, u_char *, int, u_int64_t *,
6756ca35587Sdholland     struct nfsclsession *);
6766ca35587Sdholland int newnfs_connect(struct nfsmount *, struct nfssockreq *,
677*0342d508Spgoyette     struct kauth_cred *, NFSPROC_T *, int);
6786ca35587Sdholland void newnfs_disconnect(struct nfssockreq *);
6796ca35587Sdholland int newnfs_sigintr(struct nfsmount *, NFSPROC_T *);
6806ca35587Sdholland 
6816ca35587Sdholland /* nfs_nfsdkrpc.c */
6826ca35587Sdholland int nfsrvd_addsock(struct file *);
6836ca35587Sdholland int nfsrvd_nfsd(NFSPROC_T *, struct nfsd_nfsd_args *);
6846ca35587Sdholland void nfsrvd_init(int);
6856ca35587Sdholland 
6866ca35587Sdholland /* nfs_clkrpc.c */
6876ca35587Sdholland int nfscbd_addsock(struct file *);
6886ca35587Sdholland int nfscbd_nfsd(NFSPROC_T *, struct nfsd_nfscbd_args *);
6896ca35587Sdholland 
690