| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ffs_vfsops.c,v 1.236 2008/09/21 23:22:00 freza Exp $ */ | | 1 | /* $NetBSD: ffs_vfsops.c,v 1.237 2008/09/23 15:27:59 pooka 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.236 2008/09/21 23:22:00 freza Exp $"); | | 64 | __KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.237 2008/09/23 15:27:59 pooka 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> |
| @@ -289,48 +289,43 @@ ffs_mountroot(void) | | | @@ -289,48 +289,43 @@ ffs_mountroot(void) |
289 | mutex_enter(&mountlist_lock); | | 289 | mutex_enter(&mountlist_lock); |
290 | CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list); | | 290 | CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list); |
291 | mutex_exit(&mountlist_lock); | | 291 | mutex_exit(&mountlist_lock); |
292 | ump = VFSTOUFS(mp); | | 292 | ump = VFSTOUFS(mp); |
293 | fs = ump->um_fs; | | 293 | fs = ump->um_fs; |
294 | memset(fs->fs_fsmnt, 0, sizeof(fs->fs_fsmnt)); | | 294 | memset(fs->fs_fsmnt, 0, sizeof(fs->fs_fsmnt)); |
295 | (void)copystr(mp->mnt_stat.f_mntonname, fs->fs_fsmnt, MNAMELEN - 1, 0); | | 295 | (void)copystr(mp->mnt_stat.f_mntonname, fs->fs_fsmnt, MNAMELEN - 1, 0); |
296 | (void)ffs_statvfs(mp, &mp->mnt_stat); | | 296 | (void)ffs_statvfs(mp, &mp->mnt_stat); |
297 | vfs_unbusy(mp, false, NULL); | | 297 | vfs_unbusy(mp, false, NULL); |
298 | setrootfstime((time_t)fs->fs_time); | | 298 | setrootfstime((time_t)fs->fs_time); |
299 | return (0); | | 299 | return (0); |
300 | } | | 300 | } |
301 | | | 301 | |
302 | static int dolog; | | | |
303 | | | | |
304 | /* | | 302 | /* |
305 | * VFS Operations. | | 303 | * VFS Operations. |
306 | * | | 304 | * |
307 | * mount system call | | 305 | * mount system call |
308 | */ | | 306 | */ |
309 | int | | 307 | int |
310 | ffs_mount(struct mount *mp, const char *path, void *data, size_t *data_len) | | 308 | ffs_mount(struct mount *mp, const char *path, void *data, size_t *data_len) |
311 | { | | 309 | { |
312 | struct lwp *l = curlwp; | | 310 | struct lwp *l = curlwp; |
313 | struct nameidata nd; | | 311 | struct nameidata nd; |
314 | struct vnode *vp, *devvp = NULL; | | 312 | struct vnode *vp, *devvp = NULL; |
315 | struct ufs_args *args = data; | | 313 | struct ufs_args *args = data; |
316 | struct ufsmount *ump = NULL; | | 314 | struct ufsmount *ump = NULL; |
317 | struct fs *fs; | | 315 | struct fs *fs; |
318 | int error = 0, flags, update; | | 316 | int error = 0, flags, update; |
319 | mode_t accessmode; | | 317 | mode_t accessmode; |
320 | | | 318 | |
321 | if (dolog) | | | |
322 | mp->mnt_flag |= MNT_LOG; | | | |
323 | | | | |
324 | if (*data_len < sizeof *args) | | 319 | if (*data_len < sizeof *args) |
325 | return EINVAL; | | 320 | return EINVAL; |
326 | | | 321 | |
327 | if (mp->mnt_flag & MNT_GETARGS) { | | 322 | if (mp->mnt_flag & MNT_GETARGS) { |
328 | ump = VFSTOUFS(mp); | | 323 | ump = VFSTOUFS(mp); |
329 | if (ump == NULL) | | 324 | if (ump == NULL) |
330 | return EIO; | | 325 | return EIO; |
331 | args->fspec = NULL; | | 326 | args->fspec = NULL; |
332 | *data_len = sizeof *args; | | 327 | *data_len = sizeof *args; |
333 | return 0; | | 328 | return 0; |
334 | } | | 329 | } |
335 | | | 330 | |
336 | #if !defined(SOFTDEP) | | 331 | #if !defined(SOFTDEP) |