overlay.h revision 1.2.6.2 1 1.2.6.2 bouyer /* $NetBSD: overlay.h,v 1.2.6.2 2000/11/20 18:09:47 bouyer Exp $ */
2 1.2.6.2 bouyer
3 1.2.6.2 bouyer /*
4 1.2.6.2 bouyer * Copyright (c) 1999 National Aeronautics & Space Administration
5 1.2.6.2 bouyer * All rights reserved.
6 1.2.6.2 bouyer *
7 1.2.6.2 bouyer * This software was written by William Studnemund of the
8 1.2.6.2 bouyer * Numerical Aerospace Similation Facility, NASA Ames Research Center.
9 1.2.6.2 bouyer *
10 1.2.6.2 bouyer * Redistribution and use in source and binary forms, with or without
11 1.2.6.2 bouyer * modification, are permitted provided that the following conditions
12 1.2.6.2 bouyer * are met:
13 1.2.6.2 bouyer * 1. Redistributions of source code must retain the above copyright
14 1.2.6.2 bouyer * notice, this list of conditions and the following disclaimer.
15 1.2.6.2 bouyer * 2. Redistributions in binary form must reproduce the above copyright
16 1.2.6.2 bouyer * notice, this list of conditions and the following disclaimer in the
17 1.2.6.2 bouyer * documentation and/or other materials provided with the distribution.
18 1.2.6.2 bouyer * 3. Neither the name of the National Aeronautics & Space Administration
19 1.2.6.2 bouyer * nor the names of its contributors may be used to endorse or promote
20 1.2.6.2 bouyer * products derived from this software without specific prior written
21 1.2.6.2 bouyer * permission.
22 1.2.6.2 bouyer *
23 1.2.6.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE NATIONAL AERONAUTICS & SPACE ADMINISTRATION
24 1.2.6.2 bouyer * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25 1.2.6.2 bouyer * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 1.2.6.2 bouyer * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ADMINISTRATION OR CONTRIB-
27 1.2.6.2 bouyer * UTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
28 1.2.6.2 bouyer * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 1.2.6.2 bouyer * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 1.2.6.2 bouyer * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 1.2.6.2 bouyer * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 1.2.6.2 bouyer * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 1.2.6.2 bouyer * POSSIBILITY OF SUCH DAMAGE.
34 1.2.6.2 bouyer */
35 1.2.6.2 bouyer
36 1.2.6.2 bouyer /*
37 1.2.6.2 bouyer * Copyright (c) 1992, 1993
38 1.2.6.2 bouyer * The Regents of the University of California. All rights reserved.
39 1.2.6.2 bouyer *
40 1.2.6.2 bouyer * This code is derived from software donated to Berkeley by
41 1.2.6.2 bouyer * Jan-Simon Pendry.
42 1.2.6.2 bouyer *
43 1.2.6.2 bouyer * Redistribution and use in source and binary forms, with or without
44 1.2.6.2 bouyer * modification, are permitted provided that the following conditions
45 1.2.6.2 bouyer * are met:
46 1.2.6.2 bouyer * 1. Redistributions of source code must retain the above copyright
47 1.2.6.2 bouyer * notice, this list of conditions and the following disclaimer.
48 1.2.6.2 bouyer * 2. Redistributions in binary form must reproduce the above copyright
49 1.2.6.2 bouyer * notice, this list of conditions and the following disclaimer in the
50 1.2.6.2 bouyer * documentation and/or other materials provided with the distribution.
51 1.2.6.2 bouyer * 3. All advertising materials mentioning features or use of this software
52 1.2.6.2 bouyer * must display the following acknowledgement:
53 1.2.6.2 bouyer * This product includes software developed by the University of
54 1.2.6.2 bouyer * California, Berkeley and its contributors.
55 1.2.6.2 bouyer * 4. Neither the name of the University nor the names of its contributors
56 1.2.6.2 bouyer * may be used to endorse or promote products derived from this software
57 1.2.6.2 bouyer * without specific prior written permission.
58 1.2.6.2 bouyer *
59 1.2.6.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
60 1.2.6.2 bouyer * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61 1.2.6.2 bouyer * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
62 1.2.6.2 bouyer * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
63 1.2.6.2 bouyer * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
64 1.2.6.2 bouyer * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
65 1.2.6.2 bouyer * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66 1.2.6.2 bouyer * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67 1.2.6.2 bouyer * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68 1.2.6.2 bouyer * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69 1.2.6.2 bouyer * SUCH DAMAGE.
70 1.2.6.2 bouyer *
71 1.2.6.2 bouyer * from: Id: lofs.h,v 1.8 1992/05/30 10:05:43 jsp Exp
72 1.2.6.2 bouyer * @(#)null.h 8.2 (Berkeley) 1/21/94
73 1.2.6.2 bouyer */
74 1.2.6.2 bouyer
75 1.2.6.2 bouyer #include <miscfs/genfs/layer.h>
76 1.2.6.2 bouyer
77 1.2.6.2 bouyer struct overlay_args {
78 1.2.6.2 bouyer struct layer_args la; /* generic layerfs args */
79 1.2.6.2 bouyer };
80 1.2.6.2 bouyer /*
81 1.2.6.2 bouyer * We leave ova_target for two reasons. One, We can tell the difference
82 1.2.6.2 bouyer * between a mount_overlay -u and a call from mountd as the former will
83 1.2.6.2 bouyer * pass a pointer to a string while the latter will pass NULL. Two,
84 1.2.6.2 bouyer * filesystems based on the overlay layer might have use for it.
85 1.2.6.2 bouyer */
86 1.2.6.2 bouyer #define ova_target la.target
87 1.2.6.2 bouyer #define ova_export la.export
88 1.2.6.2 bouyer
89 1.2.6.2 bouyer #ifdef _KERNEL
90 1.2.6.2 bouyer struct overlay_mount {
91 1.2.6.2 bouyer struct layer_mount lm; /* generic layerfs mount stuff */
92 1.2.6.2 bouyer };
93 1.2.6.2 bouyer #define ovm_vfs lm.layerm_vfs
94 1.2.6.2 bouyer #define ovm_rootvp lm.layerm_rootvp
95 1.2.6.2 bouyer #define ovm_export lm.layerm_export
96 1.2.6.2 bouyer #define ovm_flags lm.layerm_flags
97 1.2.6.2 bouyer #define ovm_size lm.layerm_size
98 1.2.6.2 bouyer #define ovm_tag lm.layerm_tag
99 1.2.6.2 bouyer #define ovm_bypass lm.layerm_bypass
100 1.2.6.2 bouyer #define ovm_alloc lm.layerm_alloc
101 1.2.6.2 bouyer #define ovm_vnodeop_p lm.layerm_vnodeop_p
102 1.2.6.2 bouyer #define ovm_node_hashtbl lm.layerm_node_hashtbl
103 1.2.6.2 bouyer #define ovm_node_hash lm.layerm_node_hash
104 1.2.6.2 bouyer #define ovm_hashlock lm.layerm_hashlock
105 1.2.6.2 bouyer
106 1.2.6.2 bouyer /*
107 1.2.6.2 bouyer * A cache of vnode references
108 1.2.6.2 bouyer */
109 1.2.6.2 bouyer struct overlay_node {
110 1.2.6.2 bouyer struct layer_node ln;
111 1.2.6.2 bouyer };
112 1.2.6.2 bouyer #define ov_hash ln.layer_hash
113 1.2.6.2 bouyer #define ov_lowervp ln.layer_lowervp
114 1.2.6.2 bouyer #define ov_vnode ln.layer_vnode
115 1.2.6.2 bouyer #define ov_flags ln.layer_flags
116 1.2.6.2 bouyer
117 1.2.6.2 bouyer #define MOUNTTOOVERLAYMOUNT(mp) ((struct overlay_mount *)((mp)->mnt_data))
118 1.2.6.2 bouyer #define VTOOVERLAY(vp) ((struct overlay_node *)(vp)->v_data)
119 1.2.6.2 bouyer #define OVERLAYTOV(xp) ((xp)->ov_vnode)
120 1.2.6.2 bouyer #ifdef OVERLAYFS_DIAGNOSTIC
121 1.2.6.2 bouyer extern struct vnode *layer_checkvp __P((struct vnode *vp, char *fil, int lno));
122 1.2.6.2 bouyer #define OVERLAYVPTOLOWERVP(vp) layer_checkvp((vp), __FILE__, __LINE__)
123 1.2.6.2 bouyer #else
124 1.2.6.2 bouyer #define OVERLAYVPTOLOWERVP(vp) (VTOOVERLAY(vp)->ov_lowervp)
125 1.2.6.2 bouyer #endif
126 1.2.6.2 bouyer
127 1.2.6.2 bouyer extern int (**overlay_vnodeop_p) __P((void *));
128 1.2.6.2 bouyer extern struct vfsops overlay_vfsops;
129 1.2.6.2 bouyer
130 1.2.6.2 bouyer #endif /* _KERNEL */
131