7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #pragma ident "%Z%%M% %I% %E% SMI"
28
29 /*
30 * This file contains interface definitions and wrappers for file
31 * system snapshot support. File systems may depend on this module
32 * for symbol resolution while the implementation may remain unloaded
33 * until needed.
34 */
35 #include <sys/types.h>
36 #include <sys/debug.h>
37 #include <sys/t_lock.h>
38 #include <sys/param.h>
39 #include <sys/mman.h>
40 #include <sys/systm.h>
41 #include <sys/errno.h>
42 #include <sys/kmem.h>
43 #include <sys/cmn_err.h>
44 #include <sys/vnode.h>
45 #include <sys/debug.h>
46 #include <sys/proc.h>
47 #include <sys/user.h>
48 #include <sys/conf.h>
112 return (snapslot);
113 }
114
115 void
116 fssnap_strategy(void *snapshot_id, struct buf *bp)
117 {
118 if (snapops.fssnap_strategy)
119 (snapops.fssnap_strategy)(snapshot_id, bp);
120 }
121
122
123 #include <sys/modctl.h>
124
125 extern struct mod_ops mod_miscops;
126
127 static struct modlmisc modlmisc = {
128 &mod_miscops, "File System Snapshot Interface",
129 };
130
131 static struct modlinkage modlinkage = {
132 MODREV_1, (void *)&modlmisc, NULL
133 };
134
135 int
136 _init(void)
137 {
138 return (mod_install(&modlinkage));
139 }
140
141 /*
142 * Unloading is MT-safe because our client drivers use
143 * the _depends_on[] mechanism - we won't go while they're
144 * still around.
145 */
146 int
147 _fini(void)
148 {
149 return (mod_remove(&modlinkage));
150 }
151
152 int
|
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * This file contains interface definitions and wrappers for file
29 * system snapshot support. File systems may depend on this module
30 * for symbol resolution while the implementation may remain unloaded
31 * until needed.
32 */
33 #include <sys/types.h>
34 #include <sys/debug.h>
35 #include <sys/t_lock.h>
36 #include <sys/param.h>
37 #include <sys/mman.h>
38 #include <sys/systm.h>
39 #include <sys/errno.h>
40 #include <sys/kmem.h>
41 #include <sys/cmn_err.h>
42 #include <sys/vnode.h>
43 #include <sys/debug.h>
44 #include <sys/proc.h>
45 #include <sys/user.h>
46 #include <sys/conf.h>
110 return (snapslot);
111 }
112
113 void
114 fssnap_strategy(void *snapshot_id, struct buf *bp)
115 {
116 if (snapops.fssnap_strategy)
117 (snapops.fssnap_strategy)(snapshot_id, bp);
118 }
119
120
121 #include <sys/modctl.h>
122
123 extern struct mod_ops mod_miscops;
124
125 static struct modlmisc modlmisc = {
126 &mod_miscops, "File System Snapshot Interface",
127 };
128
129 static struct modlinkage modlinkage = {
130 MODREV_1, { (void *)&modlmisc, NULL }
131 };
132
133 int
134 _init(void)
135 {
136 return (mod_install(&modlinkage));
137 }
138
139 /*
140 * Unloading is MT-safe because our client drivers use
141 * the _depends_on[] mechanism - we won't go while they're
142 * still around.
143 */
144 int
145 _fini(void)
146 {
147 return (mod_remove(&modlinkage));
148 }
149
150 int
|