| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ffs_vfsops.c,v 1.231 2008/07/31 05:38:06 simonb Exp $ */ | | 1 | /* $NetBSD: ffs_vfsops.c,v 1.232 2008/07/31 15:37:56 hannken Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Wasabi Systems, Inc. | | 8 | * by Wasabi Systems, Inc. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -51,27 +51,27 @@ | | | @@ -51,27 +51,27 @@ |
51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
58 | * SUCH DAMAGE. | | 58 | * SUCH DAMAGE. |
59 | * | | 59 | * |
60 | * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95 | | 60 | * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95 |
61 | */ | | 61 | */ |
62 | | | 62 | |
63 | #include <sys/cdefs.h> | | 63 | #include <sys/cdefs.h> |
64 | __KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.231 2008/07/31 05:38:06 simonb Exp $"); | | 64 | __KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.232 2008/07/31 15:37:56 hannken Exp $"); |
65 | | | 65 | |
66 | #if defined(_KERNEL_OPT) | | 66 | #if defined(_KERNEL_OPT) |
67 | #include "opt_ffs.h" | | 67 | #include "opt_ffs.h" |
68 | #include "opt_quota.h" | | 68 | #include "opt_quota.h" |
69 | #include "opt_softdep.h" | | 69 | #include "opt_softdep.h" |
70 | #include "opt_wapbl.h" | | 70 | #include "opt_wapbl.h" |
71 | #endif | | 71 | #endif |
72 | | | 72 | |
73 | #include <sys/param.h> | | 73 | #include <sys/param.h> |
74 | #include <sys/systm.h> | | 74 | #include <sys/systm.h> |
75 | #include <sys/namei.h> | | 75 | #include <sys/namei.h> |
76 | #include <sys/proc.h> | | 76 | #include <sys/proc.h> |
77 | #include <sys/kernel.h> | | 77 | #include <sys/kernel.h> |
| @@ -1281,46 +1281,53 @@ ffs_mountfs(struct vnode *devvp, struct | | | @@ -1281,46 +1281,53 @@ ffs_mountfs(struct vnode *devvp, struct |
1281 | ump->um_lognindir = ffs(fs->fs_nindir) - 1; | | 1281 | ump->um_lognindir = ffs(fs->fs_nindir) - 1; |
1282 | ump->um_bptrtodb = fs->fs_fsbtodb; | | 1282 | ump->um_bptrtodb = fs->fs_fsbtodb; |
1283 | ump->um_seqinc = fs->fs_frag; | | 1283 | ump->um_seqinc = fs->fs_frag; |
1284 | for (i = 0; i < MAXQUOTAS; i++) | | 1284 | for (i = 0; i < MAXQUOTAS; i++) |
1285 | ump->um_quotas[i] = NULLVP; | | 1285 | ump->um_quotas[i] = NULLVP; |
1286 | devvp->v_specmountpoint = mp; | | 1286 | devvp->v_specmountpoint = mp; |
1287 | if (ronly == 0 && (fs->fs_flags & FS_DOSOFTDEP)) { | | 1287 | if (ronly == 0 && (fs->fs_flags & FS_DOSOFTDEP)) { |
1288 | error = softdep_mount(devvp, mp, fs, cred); | | 1288 | error = softdep_mount(devvp, mp, fs, cred); |
1289 | if (error) { | | 1289 | if (error) { |
1290 | free(fs->fs_csp, M_UFSMNT); | | 1290 | free(fs->fs_csp, M_UFSMNT); |
1291 | goto out; | | 1291 | goto out; |
1292 | } | | 1292 | } |
1293 | } | | 1293 | } |
| | | 1294 | /* Snapshots do not work yet with WAPBL. */ |
| | | 1295 | if (ronly == 0 && fs->fs_snapinum[0] != 0 && (mp->mnt_flag & MNT_LOG)) { |
| | | 1296 | printf("%s fs has snapshots -- logging not supported yet\n", |
| | | 1297 | fs->fs_fsmnt); |
| | | 1298 | error = EINVAL; |
| | | 1299 | free(fs->fs_csp, M_UFSMNT); |
| | | 1300 | goto out; |
| | | 1301 | } |
| | | 1302 | if (ronly == 0 && fs->fs_snapinum[0] != 0) |
| | | 1303 | ffs_snapshot_mount(mp); |
1294 | | | 1304 | |
1295 | #ifdef WAPBL | | 1305 | #ifdef WAPBL |
1296 | if (!ronly) { | | 1306 | if (!ronly) { |
1297 | KDASSERT(fs->fs_ronly == 0); | | 1307 | KDASSERT(fs->fs_ronly == 0); |
1298 | /* | | 1308 | /* |
1299 | * ffs_wapbl_start() needs mp->mnt_stat initialised if it | | 1309 | * ffs_wapbl_start() needs mp->mnt_stat initialised if it |
1300 | * needs to create a new log file in-filesystem. | | 1310 | * needs to create a new log file in-filesystem. |
1301 | */ | | 1311 | */ |
1302 | ffs_statvfs(mp, &mp->mnt_stat); | | 1312 | ffs_statvfs(mp, &mp->mnt_stat); |
1303 | | | 1313 | |
1304 | error = ffs_wapbl_start(mp); | | 1314 | error = ffs_wapbl_start(mp); |
1305 | if (error) { | | 1315 | if (error) { |
1306 | free(fs->fs_csp, M_UFSMNT); | | 1316 | free(fs->fs_csp, M_UFSMNT); |
1307 | goto out; | | 1317 | goto out; |
1308 | } | | 1318 | } |
1309 | } | | 1319 | } |
1310 | #endif /* WAPBL */ | | 1320 | #endif /* WAPBL */ |
1311 | | | | |
1312 | if (ronly == 0 && fs->fs_snapinum[0] != 0) | | | |
1313 | ffs_snapshot_mount(mp); | | | |
1314 | #ifdef UFS_EXTATTR | | 1321 | #ifdef UFS_EXTATTR |
1315 | /* | | 1322 | /* |
1316 | * Initialize file-backed extended attributes on UFS1 file | | 1323 | * Initialize file-backed extended attributes on UFS1 file |
1317 | * systems. | | 1324 | * systems. |
1318 | */ | | 1325 | */ |
1319 | if (ump->um_fstype == UFS1) { | | 1326 | if (ump->um_fstype == UFS1) { |
1320 | ufs_extattr_uepm_init(&ump->um_extattr); | | 1327 | ufs_extattr_uepm_init(&ump->um_extattr); |
1321 | #ifdef UFS_EXTATTR_AUTOSTART | | 1328 | #ifdef UFS_EXTATTR_AUTOSTART |
1322 | /* | | 1329 | /* |
1323 | * XXX Just ignore errors. Not clear that we should | | 1330 | * XXX Just ignore errors. Not clear that we should |
1324 | * XXX fail the mount in this case. | | 1331 | * XXX fail the mount in this case. |
1325 | */ | | 1332 | */ |
1326 | (void) ufs_extattr_autostart(mp, l); | | 1333 | (void) ufs_extattr_autostart(mp, l); |