Module Name: src Committed By: riastradh Date: Sun Feb 23 08:40:49 UTC 2020
Modified Files: src/sys/ufs/lfs: lfs_vfsops.c Log Message: Initialize/destroy lfs_allclean_wakeup in modcmd, not lfs_mountfs. Fixes reloading lfs.kmod. To generate a diff of this commit: cvs rdiff -u -r1.371 -r1.372 src/sys/ufs/lfs/lfs_vfsops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/ufs/lfs/lfs_vfsops.c diff -u src/sys/ufs/lfs/lfs_vfsops.c:1.371 src/sys/ufs/lfs/lfs_vfsops.c:1.372 --- src/sys/ufs/lfs/lfs_vfsops.c:1.371 Sun Feb 23 08:39:18 2020 +++ src/sys/ufs/lfs/lfs_vfsops.c Sun Feb 23 08:40:49 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_vfsops.c,v 1.371 2020/02/23 08:39:18 riastradh Exp $ */ +/* $NetBSD: lfs_vfsops.c,v 1.372 2020/02/23 08:40:49 riastradh Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007 @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.371 2020/02/23 08:39:18 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.372 2020/02/23 08:40:49 riastradh Exp $"); #if defined(_KERNEL_OPT) #include "opt_lfs.h" @@ -356,6 +356,7 @@ lfs_modcmd(modcmd_t cmd, void *arg) break; } lfs_sysctl_setup(&lfs_sysctl_log); + cv_init(&lfs_allclean_wakeup, "segment"); break; case MODULE_CMD_FINI: error = vfs_detach(&lfs_vfsops); @@ -363,6 +364,7 @@ lfs_modcmd(modcmd_t cmd, void *arg) break; syscall_disestablish(NULL, lfs_syscalls); sysctl_teardown(&lfs_sysctl_log); + cv_destroy(&lfs_allclean_wakeup); break; default: error = ENOTTY; @@ -857,7 +859,6 @@ lfs_checkmagic(struct lfs *fs) int lfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l) { - static bool lfs_mounted_once = false; struct lfs *primarysb, *altsb, *thesb; struct buf *primarybuf, *altbuf; struct lfs *fs; @@ -1091,12 +1092,6 @@ lfs_mountfs(struct vnode *devvp, struct cv_init(&fs->lfs_stopcv, "lfsstop"); cv_init(&fs->lfs_nextsegsleep, "segment"); - /* Initialize values for all LFS mounts */ - if (!lfs_mounted_once) { - cv_init(&lfs_allclean_wakeup, "segment"); - lfs_mounted_once = true; - } - /* Set the file system readonly/modify bits. */ fs->lfs_ronly = ronly; if (ronly == 0)