Annotation of src/sys/nfs/nfs_var.h, Revision 1.53.6.2
1.53.6.2! yamt 1: /* $NetBSD: nfs_var.h,v 1.53.6.1 2005/11/15 03:48:47 yamt Exp $ */
1.1 christos 2:
1.15 christos 3: /*-
4: * Copyright (c) 1996 The NetBSD Foundation, Inc.
5: * All rights reserved.
6: *
7: * This code is derived from software contributed to The NetBSD Foundation
8: * by Christos Zoulas.
1.1 christos 9: *
10: * Redistribution and use in source and binary forms, with or without
11: * modification, are permitted provided that the following conditions
12: * are met:
13: * 1. Redistributions of source code must retain the above copyright
14: * notice, this list of conditions and the following disclaimer.
15: * 2. Redistributions in binary form must reproduce the above copyright
16: * notice, this list of conditions and the following disclaimer in the
17: * documentation and/or other materials provided with the distribution.
18: * 3. All advertising materials mentioning features or use of this software
19: * must display the following acknowledgement:
1.15 christos 20: * This product includes software developed by the NetBSD
21: * Foundation, Inc. and its contributors.
22: * 4. Neither the name of The NetBSD Foundation nor the names of its
23: * contributors may be used to endorse or promote products derived
24: * from this software without specific prior written permission.
1.1 christos 25: *
1.15 christos 26: * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27: * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28: * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30: * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36: * POSSIBILITY OF SUCH DAMAGE.
1.1 christos 37: */
38:
1.3 fvdl 39: /*
40: * XXX needs <nfs/rpcv2.h> and <nfs/nfs.h> because of typedefs
41: */
1.27 thorpej 42:
1.28 christos 43: #ifdef _KERNEL
1.27 thorpej 44: #include <sys/mallocvar.h>
1.37 yamt 45: #include <sys/pool.h>
1.27 thorpej 46:
47: MALLOC_DECLARE(M_NFSREQ);
48: MALLOC_DECLARE(M_NFSMNT);
49: MALLOC_DECLARE(M_NFSUID);
50: MALLOC_DECLARE(M_NFSD);
51: MALLOC_DECLARE(M_NFSDIROFF);
52: MALLOC_DECLARE(M_NFSBIGFH);
53: MALLOC_DECLARE(M_NQLEASE);
1.37 yamt 54: extern struct pool nfs_srvdesc_pool;
1.3 fvdl 55:
1.1 christos 56: struct vnode;
57: struct uio;
58: struct ucred;
59: struct proc;
60: struct buf;
61: struct nfs_diskless;
62: struct sockaddr_in;
63: struct nfs_dlmount;
64: struct vnode;
65: struct nfsd;
66: struct mbuf;
67: struct file;
68: struct nqlease;
69: struct nqhost;
70: struct nfssvc_sock;
71: struct nfsmount;
72: struct socket;
73: struct nfsreq;
74: struct vattr;
75: struct nameidata;
76: struct nfsnode;
77: struct sillyrename;
78: struct componentname;
1.2 christos 79: struct nfsd_srvargs;
1.3 fvdl 80: struct nfsrv_descript;
81: struct nfs_fattr;
1.10 fvdl 82: struct nfsdircache;
1.13 mrg 83: union nethostaddr;
1.53.6.1 yamt 84: struct uvm_ractx;
1.1 christos 85:
86: /* nfs_bio.c */
1.53.6.2! yamt 87: int nfs_bioread __P((struct vnode *, struct uio *, int, struct ucred *, int));
1.41 fvdl 88: struct buf *nfs_getcacheblk __P((struct vnode *, daddr_t, int, struct proc *));
89: int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *,
1.1 christos 90: int));
1.47 yamt 91: int nfs_flushstalebuf __P((struct vnode *, struct ucred *, struct proc *, int));
92: #define NFS_FLUSHSTALEBUF_MYWRITE 1 /* assume writes are ours */
1.19 chs 93: int nfs_asyncio __P((struct buf *));
1.51 christos 94: int nfs_doio __P((struct buf *));
1.1 christos 95:
96: /* nfs_boot.c */
1.9 gwr 97: /* see nfsdiskless.h */
1.25 jdolecek 98:
99: /* nfs_kq.c */
100: void nfs_kqinit __P((void));
1.1 christos 101:
102: /* nfs_node.c */
103: void nfs_nhinit __P((void));
1.20 chs 104: void nfs_nhreinit __P((void));
1.16 jdolecek 105: void nfs_nhdone __P((void));
1.43 yamt 106: int nfs_nget1 __P((struct mount *, nfsfh_t *, int, struct nfsnode **, int));
107: #define nfs_nget(mp, fhp, fhsize, npp) \
108: nfs_nget1((mp), (fhp), (fhsize), (npp), 0)
1.1 christos 109:
110: /* nfs_vnops.c */
1.41 fvdl 111: int nfs_null __P((struct vnode *, struct ucred *, struct proc *));
1.3 fvdl 112: int nfs_setattrrpc __P((struct vnode *, struct vattr *, struct ucred *,
1.41 fvdl 113: struct proc *));
1.1 christos 114: int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *));
1.19 chs 115: int nfs_readrpc __P((struct vnode *, struct uio *));
1.34 yamt 116: int nfs_writerpc __P((struct vnode *, struct uio *, int *, boolean_t,
117: boolean_t *));
1.3 fvdl 118: int nfs_mknodrpc __P((struct vnode *, struct vnode **, struct componentname *,
119: struct vattr *));
1.1 christos 120: int nfs_removeit __P((struct sillyrename *));
1.5 cgd 121: int nfs_removerpc __P((struct vnode *, const char *, int, struct ucred *,
1.41 fvdl 122: struct proc *));
1.1 christos 123: int nfs_renameit __P((struct vnode *, struct componentname *,
124: struct sillyrename *));
1.5 cgd 125: int nfs_renamerpc __P((struct vnode *, const char *, int, struct vnode *,
1.41 fvdl 126: const char *, int, struct ucred *, struct proc *));
1.1 christos 127: int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *));
1.3 fvdl 128: int nfs_readdirplusrpc __P((struct vnode *, struct uio *, struct ucred *));
1.1 christos 129: int nfs_sillyrename __P((struct vnode *, struct vnode *,
130: struct componentname *));
1.5 cgd 131: int nfs_lookitup __P((struct vnode *, const char *, int, struct ucred *,
1.41 fvdl 132: struct proc *, struct nfsnode **));
133: int nfs_commit __P((struct vnode *, off_t, uint32_t, struct proc *));
134: int nfs_flush __P((struct vnode *, struct ucred *, int, struct proc *, int));
1.1 christos 135:
136: /* nfs_nqlease.c */
1.3 fvdl 137: void nqnfs_lease_updatetime __P((int));
138: void nqnfs_clientlease __P((struct nfsmount *, struct nfsnode *, int, int,
139: time_t, u_quad_t));
140: void nqsrv_locklease __P((struct nqlease *));
141: void nqsrv_unlocklease __P((struct nqlease *));
142: int nqsrv_getlease __P((struct vnode *, u_int32_t *, int, struct nfssvc_sock *,
1.41 fvdl 143: struct proc *, struct mbuf *, int *, u_quad_t *,
1.3 fvdl 144: struct ucred *));
1.1 christos 145: void nqsrv_addhost __P((struct nqhost *, struct nfssvc_sock *, struct mbuf *));
1.3 fvdl 146: void nqsrv_instimeq __P((struct nqlease *, u_int32_t));
1.1 christos 147: int nqsrv_cmpnam __P((struct nfssvc_sock *, struct mbuf *, struct nqhost *));
148: void nqsrv_send_eviction __P((struct vnode *, struct nqlease *,
149: struct nfssvc_sock *, struct mbuf *,
1.45 jonathan 150: struct ucred *, struct proc *));
1.1 christos 151: void nqsrv_waitfor_expiry __P((struct nqlease *));
152: void nqnfs_serverd __P((void));
1.3 fvdl 153: int nqnfsrv_getlease __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 154: struct proc *, struct mbuf **));
1.3 fvdl 155: int nqnfsrv_vacated __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 156: struct proc *, struct mbuf **));
157: int nqnfs_getlease __P((struct vnode *, int, struct ucred *, struct proc *));
1.45 jonathan 158: int nqnfs_vacated __P((struct vnode *, struct ucred *, struct proc *));
1.1 christos 159: int nqnfs_callback __P((struct nfsmount *, struct mbuf *, struct mbuf *,
1.41 fvdl 160: caddr_t));
1.1 christos 161:
162: /* nfs_serv.c */
1.3 fvdl 163: int nfsrv3_access __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 164: struct proc *, struct mbuf **));
1.3 fvdl 165: int nfsrv_getattr __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 166: struct proc *, struct mbuf **));
1.3 fvdl 167: int nfsrv_setattr __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 168: struct proc *, struct mbuf **));
1.3 fvdl 169: int nfsrv_lookup __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 170: struct proc *, struct mbuf **));
1.3 fvdl 171: int nfsrv_readlink __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 172: struct proc *, struct mbuf **));
1.3 fvdl 173: int nfsrv_read __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 174: struct proc *, struct mbuf **));
1.3 fvdl 175: int nfsrv_write __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 176: struct proc *, struct mbuf **));
1.3 fvdl 177: int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
1.41 fvdl 178: struct proc *, struct mbuf **));
1.3 fvdl 179: void nfsrvw_coalesce __P((struct nfsrv_descript *, struct nfsrv_descript *));
180: int nfsrv_create __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 181: struct proc *, struct mbuf **));
1.3 fvdl 182: int nfsrv_mknod __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 183: struct proc *, struct mbuf **));
1.3 fvdl 184: int nfsrv_remove __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 185: struct proc *, struct mbuf **));
1.3 fvdl 186: int nfsrv_rename __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 187: struct proc *, struct mbuf **));
1.3 fvdl 188: int nfsrv_link __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 189: struct proc *, struct mbuf **));
1.3 fvdl 190: int nfsrv_symlink __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 191: struct proc *, struct mbuf **));
1.3 fvdl 192: int nfsrv_mkdir __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 193: struct proc *, struct mbuf **));
1.3 fvdl 194: int nfsrv_rmdir __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 195: struct proc *, struct mbuf **));
1.3 fvdl 196: int nfsrv_readdir __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 197: struct proc *, struct mbuf **));
1.3 fvdl 198: int nfsrv_readdirplus __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 199: struct proc *, struct mbuf **));
1.3 fvdl 200: int nfsrv_commit __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 201: struct proc *, struct mbuf **));
1.3 fvdl 202: int nfsrv_statfs __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 203: struct proc *, struct mbuf **));
1.3 fvdl 204: int nfsrv_fsinfo __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 205: struct proc *, struct mbuf **));
1.3 fvdl 206: int nfsrv_pathconf __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 207: struct proc *, struct mbuf **));
1.3 fvdl 208: int nfsrv_null __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 209: struct proc *, struct mbuf **));
1.3 fvdl 210: int nfsrv_noop __P((struct nfsrv_descript *, struct nfssvc_sock *,
1.41 fvdl 211: struct proc *, struct mbuf **));
212: int nfsrv_access __P((struct vnode *, int, struct ucred *, int, struct proc *,
1.6 fvdl 213: int));
1.1 christos 214:
215: /* nfs_socket.c */
1.45 jonathan 216: int nfs_connect __P((struct nfsmount *, struct nfsreq *, struct proc *));
217: int nfs_reconnect __P((struct nfsreq *, struct proc *));
1.1 christos 218: void nfs_disconnect __P((struct nfsmount *));
1.12 fvdl 219: void nfs_safedisconnect __P((struct nfsmount *));
1.1 christos 220: int nfs_send __P((struct socket *, struct mbuf *, struct mbuf *,
1.45 jonathan 221: struct nfsreq *, struct proc *));
222: int nfs_receive __P((struct nfsreq *, struct mbuf **, struct mbuf **,
223: struct proc *));
224: int nfs_reply __P((struct nfsreq *, struct proc *));
1.41 fvdl 225: int nfs_request __P((struct nfsnode *, struct mbuf *, int, struct proc *,
1.1 christos 226: struct ucred *, struct mbuf **, struct mbuf **,
1.44 yamt 227: caddr_t *, int *));
1.3 fvdl 228: int nfs_rephead __P((int, struct nfsrv_descript *, struct nfssvc_sock *,
229: int, int, u_quad_t *, struct mbuf **, struct mbuf **, caddr_t *));
1.1 christos 230: void nfs_timer __P((void *));
1.41 fvdl 231: int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *));
1.1 christos 232: int nfs_sndlock __P((int *, struct nfsreq *));
1.41 fvdl 233: void nfs_exit __P((struct proc *, void *));
1.1 christos 234: void nfs_sndunlock __P((int *));
235: int nfs_rcvlock __P((struct nfsreq *));
1.35 yamt 236: void nfs_rcvunlock __P((struct nfsmount *));
1.3 fvdl 237: int nfs_getreq __P((struct nfsrv_descript *, struct nfsd *, int));
1.50 christos 238: int nfs_msg __P((struct proc *, const char *, const char *));
1.1 christos 239: void nfsrv_rcv __P((struct socket *, caddr_t, int));
240: int nfsrv_getstream __P((struct nfssvc_sock *, int));
1.3 fvdl 241: int nfsrv_dorec __P((struct nfssvc_sock *, struct nfsd *,
242: struct nfsrv_descript **));
1.1 christos 243: void nfsrv_wakenfsd __P((struct nfssvc_sock *));
244:
245: /* nfs_srvcache.c */
1.3 fvdl 246: void nfsrv_initcache __P((void ));
247: int nfsrv_getcache __P((struct nfsrv_descript *, struct nfssvc_sock *,
248: struct mbuf **));
249: void nfsrv_updatecache __P((struct nfsrv_descript *, int, struct mbuf *));
1.1 christos 250: void nfsrv_cleancache __P((void));
251:
252: /* nfs_subs.c */
1.30 drochner 253: struct mbuf *nfsm_reqh __P((struct nfsnode *, u_long, int, caddr_t *));
1.3 fvdl 254: struct mbuf *nfsm_rpchead __P((struct ucred *, int, int, int, int, char *, int,
255: char *, struct mbuf *, int, struct mbuf **,
1.1 christos 256: u_int32_t *));
257: int nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *));
258: int nfsm_uiotombuf __P((struct uio *, struct mbuf **, int, caddr_t *));
259: int nfsm_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
260: int nfs_adv __P((struct mbuf **, caddr_t *, int, int));
1.5 cgd 261: int nfsm_strtmbuf __P((struct mbuf **, char **, const char *, long));
1.10 fvdl 262: u_long nfs_dirhash __P((off_t));
1.11 fvdl 263: void nfs_initdircache __P((struct vnode *));
1.36 yamt 264: void nfs_initdirxlatecookie __P((struct vnode *));
1.11 fvdl 265: struct nfsdircache *nfs_searchdircache __P((struct vnode *, off_t, int, int *));
1.22 jdolecek 266: struct nfsdircache *nfs_enterdircache __P((struct vnode *, off_t, off_t, int, daddr_t));
1.46 yamt 267: void nfs_putdircache __P((struct nfsnode *, struct nfsdircache *));
1.11 fvdl 268: void nfs_invaldircache __P((struct vnode *, int));
1.49 yamt 269: #define NFS_INVALDIRCACHE_FORCE 1
270: #define NFS_INVALDIRCACHE_KEEPEOF 2
1.3 fvdl 271: void nfs_init __P((void));
1.8 fvdl 272: int nfsm_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *,
1.24 yamt 273: struct vattr *, int flags));
1.8 fvdl 274: int nfs_loadattrcache __P((struct vnode **, struct nfs_fattr *,
1.24 yamt 275: struct vattr *, int flags));
1.1 christos 276: int nfs_getattrcache __P((struct vnode *, struct vattr *));
1.24 yamt 277: void nfs_delayedtruncate __P((struct vnode *));
1.48 yamt 278: int nfs_check_wccdata __P((struct nfsnode *, const struct timespec *,
279: struct timespec *, boolean_t));
1.29 yamt 280: int nfs_namei __P((struct nameidata *, fhandle_t *, uint32_t,
281: struct nfssvc_sock *, struct mbuf *, struct mbuf **,
1.41 fvdl 282: caddr_t *, struct vnode **, struct proc *, int, int));
1.38 yamt 283: void nfs_zeropad __P((struct mbuf *, int, int));
1.3 fvdl 284: void nfsm_srvwcc __P((struct nfsrv_descript *, int, struct vattr *, int,
285: struct vattr *, struct mbuf **, char **));
286: void nfsm_srvpostopattr __P((struct nfsrv_descript *, int, struct vattr *,
287: struct mbuf **, char **));
288: void nfsm_srvfattr __P((struct nfsrv_descript *, struct vattr *,
289: struct nfs_fattr *));
1.1 christos 290: int nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *,
1.40 thorpej 291: struct nfssvc_sock *, struct mbuf *, int *, int, int));
1.7 fvdl 292: int nfs_ispublicfh __P((fhandle_t *));
1.1 christos 293: int netaddr_match __P((int, union nethostaddr *, struct mbuf *));
1.24 yamt 294:
295: /* flags for nfs_loadattrcache and friends */
296: #define NAC_NOTRUNC 1 /* don't truncate file size */
1.18 fvdl 297:
1.3 fvdl 298: void nfs_clearcommit __P((struct mount *));
1.18 fvdl 299: void nfs_merge_commit_ranges __P((struct vnode *));
1.19 chs 300: int nfs_in_committed_range __P((struct vnode *, off_t, off_t));
301: int nfs_in_tobecommitted_range __P((struct vnode *, off_t, off_t));
302: void nfs_add_committed_range __P((struct vnode *, off_t, off_t));
303: void nfs_del_committed_range __P((struct vnode *, off_t, off_t));
304: void nfs_add_tobecommitted_range __P((struct vnode *, off_t, off_t));
305: void nfs_del_tobecommitted_range __P((struct vnode *, off_t, off_t));
1.18 fvdl 306:
1.3 fvdl 307: int nfsrv_errmap __P((struct nfsrv_descript *, int));
308: void nfsrvw_sort __P((gid_t *, int));
309: void nfsrv_setcred __P((struct ucred *, struct ucred *));
1.41 fvdl 310: void nfs_cookieheuristic __P((struct vnode *, int *, struct proc *,
1.10 fvdl 311: struct ucred *));
1.42 yamt 312:
313: u_int32_t nfs_getxid __P((void));
314: void nfs_renewxid __P((struct nfsreq *));
1.1 christos 315:
316: /* nfs_syscalls.c */
1.26 thorpej 317: int sys_getfh __P((struct lwp *, void *, register_t *));
318: int sys_nfssvc __P((struct lwp *, void *, register_t *));
1.1 christos 319: int nfssvc_addsock __P((struct file *, struct mbuf *));
1.26 thorpej 320: int nfssvc_nfsd __P((struct nfsd_srvargs *, caddr_t, struct lwp *));
1.1 christos 321: void nfsrv_zapsock __P((struct nfssvc_sock *));
322: void nfsrv_slpderef __P((struct nfssvc_sock *));
323: void nfsrv_init __P((int));
1.26 thorpej 324: int nfssvc_iod __P((struct lwp *));
1.33 yamt 325: void nfs_iodinit __P((void));
1.17 tsarna 326: void start_nfsio __P((void *));
327: void nfs_getset_niothreads __P((int));
1.1 christos 328: int nfs_getauth __P((struct nfsmount *, struct nfsreq *, struct ucred *,
1.3 fvdl 329: char **, int *, char *, int *, NFSKERBKEY_T));
330: int nfs_getnickauth __P((struct nfsmount *, struct ucred *, char **, int *,
331: char *, int));
332: int nfs_savenickauth __P((struct nfsmount *, struct ucred *, int, NFSKERBKEY_T,
333: struct mbuf **, char **, struct mbuf *));
1.52 jmmv 334:
335: /* nfs_export.c */
336: extern struct nfs_public nfs_pub;
337: int mountd_set_exports_list(const struct mountd_exports_list *, struct proc *);
338: int nfs_check_export(struct mount *, struct mbuf *, int *, struct ucred **);
1.53 jmmv 339: #ifdef COMPAT_30
340: int nfs_update_exports_30(struct mount *, const char *, void *, struct proc *);
341: #endif
1.32 yamt 342: #endif /* _KERNEL */
CVSweb <webmaster@jp.NetBSD.org>