xref: /netbsd/sys/miscfs/nullfs/null.h (revision 2d397e8e)
1 /*	$NetBSD: null.h,v 1.20 2017/04/11 07:51:37 hannken Exp $	*/
2 
3 /*
4  * Copyright (c) 1999 National Aeronautics & Space Administration
5  * All rights reserved.
6  *
7  * This software was written by William Studenmund of the
8  * Numerical Aerospace Simulation Facility, NASA Ames Research Center.
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. Neither the name of the National Aeronautics & Space Administration
19  *    nor the names of its contributors may be used to endorse or promote
20  *    products derived from this software without specific prior written
21  *    permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE NATIONAL AERONAUTICS & SPACE ADMINISTRATION
24  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ADMINISTRATION OR CONTRIB-
27  * UTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
28  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 /*
37  * Copyright (c) 1992, 1993
38  *	The Regents of the University of California.  All rights reserved.
39  *
40  * This code is derived from software donated to Berkeley by
41  * Jan-Simon Pendry.
42  *
43  * Redistribution and use in source and binary forms, with or without
44  * modification, are permitted provided that the following conditions
45  * are met:
46  * 1. Redistributions of source code must retain the above copyright
47  *    notice, this list of conditions and the following disclaimer.
48  * 2. Redistributions in binary form must reproduce the above copyright
49  *    notice, this list of conditions and the following disclaimer in the
50  *    documentation and/or other materials provided with the distribution.
51  * 3. Neither the name of the University nor the names of its contributors
52  *    may be used to endorse or promote products derived from this software
53  *    without specific prior written permission.
54  *
55  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
56  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
58  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
59  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
60  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
61  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
62  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
63  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
64  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
65  * SUCH DAMAGE.
66  *
67  *	from: Id: lofs.h,v 1.8 1992/05/30 10:05:43 jsp Exp
68  *	@(#)null.h	8.2 (Berkeley) 1/21/94
69  */
70 
71 #ifndef _MISCFS_NULLFS_H_
72 #define _MISCFS_NULLFS_H_
73 
74 #include <miscfs/genfs/layer.h>
75 
76 struct null_args {
77 	struct	layer_args	la;	/* generic layerfs args */
78 };
79 #define	nulla_target	la.target
80 #define	nulla_export	la.export
81 
82 #ifdef _KERNEL
83 struct null_mount {
84 	struct	layer_mount	lm;	/* generic layerfs mount stuff */
85 };
86 #define	nullm_rootvp		lm.layerm_rootvp
87 #define	nullm_export		lm.layerm_export
88 #define	nullm_flags		lm.layerm_flags
89 #define	nullm_size		lm.layerm_size
90 #define	nullm_tag		lm.layerm_tag
91 #define	nullm_bypass		lm.layerm_bypass
92 #define	nullm_alloc		lm.layerm_alloc
93 #define	nullm_vnodeop_p		lm.layerm_vnodeop_p
94 #define	nullm_node_hashtbl	lm.layerm_node_hashtbl
95 #define	nullm_node_hash		lm.layerm_node_hash
96 #define	nullm_hashlock		lm.layerm_hashlock
97 
98 /*
99  * A cache of vnode references
100  */
101 struct null_node {
102 	struct	layer_node	ln;
103 };
104 #define	null_hash	ln.layer_hash
105 #define	null_lowervp	ln.layer_lowervp
106 #define	null_vnode	ln.layer_vnode
107 #define	null_flags	ln.layer_flags
108 
109 #define	MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data))
110 
111 extern int (**null_vnodeop_p)(void *);
112 extern struct vfsops nullfs_vfsops;
113 
114 void nullfs_init(void);
115 
116 #endif /* _KERNEL */
117 #endif /* _MISCFS_NULLFS_H_ */
118