xref: /netbsd-src/sys/miscfs/nullfs/null.h (revision 228d72eddef2dab8c1200237a7f65bb1a21dbec4)
1*228d72edShannken /*	$NetBSD: null.h,v 1.20 2017/04/11 07:51:37 hannken Exp $	*/
29866514dSwrstuden 
39866514dSwrstuden /*
49866514dSwrstuden  * Copyright (c) 1999 National Aeronautics & Space Administration
59866514dSwrstuden  * All rights reserved.
69866514dSwrstuden  *
7e265f988Swiz  * This software was written by William Studenmund of the
8e265f988Swiz  * Numerical Aerospace Simulation Facility, NASA Ames Research Center.
99866514dSwrstuden  *
109866514dSwrstuden  * Redistribution and use in source and binary forms, with or without
119866514dSwrstuden  * modification, are permitted provided that the following conditions
129866514dSwrstuden  * are met:
139866514dSwrstuden  * 1. Redistributions of source code must retain the above copyright
149866514dSwrstuden  *    notice, this list of conditions and the following disclaimer.
159866514dSwrstuden  * 2. Redistributions in binary form must reproduce the above copyright
169866514dSwrstuden  *    notice, this list of conditions and the following disclaimer in the
179866514dSwrstuden  *    documentation and/or other materials provided with the distribution.
1895054da1Ssoren  * 3. Neither the name of the National Aeronautics & Space Administration
199866514dSwrstuden  *    nor the names of its contributors may be used to endorse or promote
209866514dSwrstuden  *    products derived from this software without specific prior written
219866514dSwrstuden  *    permission.
229866514dSwrstuden  *
239866514dSwrstuden  * THIS SOFTWARE IS PROVIDED BY THE NATIONAL AERONAUTICS & SPACE ADMINISTRATION
249866514dSwrstuden  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
259866514dSwrstuden  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
269866514dSwrstuden  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ADMINISTRATION OR CONTRIB-
279866514dSwrstuden  * UTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
289866514dSwrstuden  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
299866514dSwrstuden  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
309866514dSwrstuden  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
319866514dSwrstuden  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
329866514dSwrstuden  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
339866514dSwrstuden  * POSSIBILITY OF SUCH DAMAGE.
349866514dSwrstuden  */
35cf92afd6Scgd 
36cde1d475Smycroft /*
37cde1d475Smycroft  * Copyright (c) 1992, 1993
38cde1d475Smycroft  *	The Regents of the University of California.  All rights reserved.
39cde1d475Smycroft  *
40cde1d475Smycroft  * This code is derived from software donated to Berkeley by
41cde1d475Smycroft  * Jan-Simon Pendry.
42cde1d475Smycroft  *
43cde1d475Smycroft  * Redistribution and use in source and binary forms, with or without
44cde1d475Smycroft  * modification, are permitted provided that the following conditions
45cde1d475Smycroft  * are met:
46cde1d475Smycroft  * 1. Redistributions of source code must retain the above copyright
47cde1d475Smycroft  *    notice, this list of conditions and the following disclaimer.
48cde1d475Smycroft  * 2. Redistributions in binary form must reproduce the above copyright
49cde1d475Smycroft  *    notice, this list of conditions and the following disclaimer in the
50cde1d475Smycroft  *    documentation and/or other materials provided with the distribution.
51aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
52cde1d475Smycroft  *    may be used to endorse or promote products derived from this software
53cde1d475Smycroft  *    without specific prior written permission.
54cde1d475Smycroft  *
55cde1d475Smycroft  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
56cde1d475Smycroft  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57cde1d475Smycroft  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
58cde1d475Smycroft  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
59cde1d475Smycroft  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
60cde1d475Smycroft  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
61cde1d475Smycroft  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
62cde1d475Smycroft  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
63cde1d475Smycroft  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
64cde1d475Smycroft  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
65cde1d475Smycroft  * SUCH DAMAGE.
66cde1d475Smycroft  *
67cde1d475Smycroft  *	from: Id: lofs.h,v 1.8 1992/05/30 10:05:43 jsp Exp
68cf92afd6Scgd  *	@(#)null.h	8.2 (Berkeley) 1/21/94
69cde1d475Smycroft  */
70cde1d475Smycroft 
7197272194Srmind #ifndef _MISCFS_NULLFS_H_
7297272194Srmind #define _MISCFS_NULLFS_H_
7397272194Srmind 
749866514dSwrstuden #include <miscfs/genfs/layer.h>
75cde1d475Smycroft 
769866514dSwrstuden struct null_args {
779866514dSwrstuden 	struct	layer_args	la;	/* generic layerfs args */
78cde1d475Smycroft };
799866514dSwrstuden #define	nulla_target	la.target
809866514dSwrstuden #define	nulla_export	la.export
81cde1d475Smycroft 
826efcd1b6Sbriggs #ifdef _KERNEL
839866514dSwrstuden struct null_mount {
849866514dSwrstuden 	struct	layer_mount	lm;	/* generic layerfs mount stuff */
859866514dSwrstuden };
869866514dSwrstuden #define	nullm_rootvp		lm.layerm_rootvp
879866514dSwrstuden #define	nullm_export		lm.layerm_export
889866514dSwrstuden #define	nullm_flags		lm.layerm_flags
899866514dSwrstuden #define	nullm_size		lm.layerm_size
909866514dSwrstuden #define	nullm_tag		lm.layerm_tag
919866514dSwrstuden #define	nullm_bypass		lm.layerm_bypass
929866514dSwrstuden #define	nullm_alloc		lm.layerm_alloc
939866514dSwrstuden #define	nullm_vnodeop_p		lm.layerm_vnodeop_p
949866514dSwrstuden #define	nullm_node_hashtbl	lm.layerm_node_hashtbl
959866514dSwrstuden #define	nullm_node_hash		lm.layerm_node_hash
969866514dSwrstuden #define	nullm_hashlock		lm.layerm_hashlock
979866514dSwrstuden 
98cde1d475Smycroft /*
99cde1d475Smycroft  * A cache of vnode references
100cde1d475Smycroft  */
101cde1d475Smycroft struct null_node {
1029866514dSwrstuden 	struct	layer_node	ln;
103cde1d475Smycroft };
1049866514dSwrstuden #define	null_hash	ln.layer_hash
1059866514dSwrstuden #define	null_lowervp	ln.layer_lowervp
1069866514dSwrstuden #define	null_vnode	ln.layer_vnode
1079866514dSwrstuden #define	null_flags	ln.layer_flags
108cde1d475Smycroft 
109cde1d475Smycroft #define	MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data))
110cde1d475Smycroft 
111af97f2e8Sxtraeme extern int (**null_vnodeop_p)(void *);
112c9efd056Sthorpej extern struct vfsops nullfs_vfsops;
113631ccba6Schristos 
114af97f2e8Sxtraeme void nullfs_init(void);
115631ccba6Schristos 
1166efcd1b6Sbriggs #endif /* _KERNEL */
11797272194Srmind #endif /* _MISCFS_NULLFS_H_ */
118