| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: component.c,v 1.1 2011/01/18 22:21:23 haad Exp $ */ | | 1 | /* $NetBSD: component.c,v 1.2 2011/01/21 12:23:29 pooka Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2010 Antti Kantee. All Rights Reserved. | | 4 | * Copyright (c) 2010 Antti Kantee. All Rights Reserved. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | | 7 | * modification, are permitted provided that the following conditions |
8 | * are met: | | 8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright | | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright | | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | | 13 | * documentation and/or other materials provided with the distribution. |
14 | * | | 14 | * |
| @@ -16,27 +16,27 @@ | | | @@ -16,27 +16,27 @@ |
16 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | | 16 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | | 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | | 18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | | 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
25 | * SUCH DAMAGE. | | 25 | * SUCH DAMAGE. |
26 | */ | | 26 | */ |
27 | | | 27 | |
28 | #include <sys/cdefs.h> | | 28 | #include <sys/cdefs.h> |
29 | __KERNEL_RCSID(0, "$NetBSD: component.c,v 1.1 2011/01/18 22:21:23 haad Exp $"); | | 29 | __KERNEL_RCSID(0, "$NetBSD: component.c,v 1.2 2011/01/21 12:23:29 pooka Exp $"); |
30 | | | 30 | |
31 | #include <sys/param.h> | | 31 | #include <sys/param.h> |
32 | #include <sys/conf.h> | | 32 | #include <sys/conf.h> |
33 | #include <sys/stat.h> | | 33 | #include <sys/stat.h> |
34 | | | 34 | |
35 | #include <sys/types.h> | | 35 | #include <sys/types.h> |
36 | #include <sys/param.h> | | 36 | #include <sys/param.h> |
37 | #include <sys/errno.h> | | 37 | #include <sys/errno.h> |
38 | #include <sys/uio.h> | | 38 | #include <sys/uio.h> |
39 | #include <sys/buf.h> | | 39 | #include <sys/buf.h> |
40 | #include <sys/modctl.h> | | 40 | #include <sys/modctl.h> |
41 | #include <sys/open.h> | | 41 | #include <sys/open.h> |
42 | #include <sys/file.h> | | 42 | #include <sys/file.h> |
| @@ -70,41 +70,20 @@ __KERNEL_RCSID(0, "$NetBSD: component.c, | | | @@ -70,41 +70,20 @@ __KERNEL_RCSID(0, "$NetBSD: component.c, |
70 | #include <sys/fs/zfs.h> | | 70 | #include <sys/fs/zfs.h> |
71 | #include <sys/zfs_ctldir.h> | | 71 | #include <sys/zfs_ctldir.h> |
72 | #include <sys/zfs_dir.h> | | 72 | #include <sys/zfs_dir.h> |
73 | #include <sys/zvol.h> | | 73 | #include <sys/zvol.h> |
74 | #include <sharefs/share.h> | | 74 | #include <sharefs/share.h> |
75 | #include <sys/dmu_objset.h> | | 75 | #include <sys/dmu_objset.h> |
76 | #include <sys/callb.h> | | 76 | #include <sys/callb.h> |
77 | #include <sys/taskq.h> | | 77 | #include <sys/taskq.h> |
78 | | | 78 | |
79 | #include "rump_private.h" | | 79 | #include "rump_private.h" |
80 | #include "rump_dev_private.h" | | 80 | #include "rump_dev_private.h" |
81 | #include "rump_vfs_private.h" | | 81 | #include "rump_vfs_private.h" |
82 | | | 82 | |
83 | RUMP_COMPONENT(RUMP_COMPONENT_KERN_VFS) | | 83 | RUMP_COMPONENT(RUMP_COMPONENT_VFS) |
84 | { | | 84 | { |
85 | int error; | | | |
86 | | | | |
87 | extern int physmem; | | 85 | extern int physmem; |
88 | | | 86 | |
89 | extern uint_t zfs_fsyncer_key; | | | |
90 | extern uint_t rrw_tsd_key; | | | |
91 | | | | |
92 | extern const struct bdevsw zfs_bdevsw; | | | |
93 | extern const struct cdevsw zfs_cdevsw; | | | |
94 | | | | |
95 | static int zfs_bmajor = -1; | | | |
96 | static int zfs_cmajor = -1; | | | |
97 | | | | |
98 | /* Set physmem to fit zfs limits. ZFS_MINMEGS * 2048 / PAGE_SIZE */ | | 87 | /* Set physmem to fit zfs limits. ZFS_MINMEGS * 2048 / PAGE_SIZE */ |
99 | physmem = 262144; | | 88 | physmem = 262144; |
100 | error = devsw_attach("zfs", &zfs_bdevsw, &zfs_bmajor, | | | |
101 | &zfs_cdevsw, &zfs_cmajor); | | | |
102 | if (error != 0) { | | | |
103 | zvol_fini(); | | | |
104 | zfs_vfsfini(); | | | |
105 | spa_fini(); | | | |
106 | lwp_specific_key_delete(zfs_fsyncer_key); | | | |
107 | lwp_specific_key_delete(rrw_tsd_key); | | | |
108 | } | | | |
109 | return; | | | |
110 | } | | 89 | } |