Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/miscfs/specfs specfs: Factor KASSERT out of switch in sp...



details:   https://anonhg.NetBSD.org/src/rev/40f225c138df
branches:  trunk
changeset: 364506:40f225c138df
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Mar 28 12:35:52 2022 +0000

description:
specfs: Factor KASSERT out of switch in spec_open.

No functional change.

diffstat:

 sys/miscfs/specfs/spec_vnops.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r c0cd4362062a -r 40f225c138df sys/miscfs/specfs/spec_vnops.c
--- a/sys/miscfs/specfs/spec_vnops.c    Mon Mar 28 12:35:44 2022 +0000
+++ b/sys/miscfs/specfs/spec_vnops.c    Mon Mar 28 12:35:52 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spec_vnops.c,v 1.195 2022/03/28 12:35:44 riastradh Exp $       */
+/*     $NetBSD: spec_vnops.c,v 1.196 2022/03/28 12:35:52 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.195 2022/03/28 12:35:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.196 2022/03/28 12:35:52 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -558,13 +558,13 @@
         * can't be revoked until we release the vnode lock.
         */
        mutex_enter(&device_lock);
+       KASSERT(!sn->sn_gone);
        switch (vp->v_type) {
        case VCHR:
                /*
                 * Character devices can accept opens from multiple
                 * vnodes.
                 */
-               KASSERT(!sn->sn_gone);
                sd->sd_opencnt++;
                sn->sn_opencnt++;
                break;
@@ -577,7 +577,6 @@
                 * Treat zero opencnt with non-NULL mountpoint as open.
                 * This may happen after forced detach of a mounted device.
                 */
-               KASSERT(!sn->sn_gone);
                if (sd->sd_opencnt != 0 || sd->sd_mountpoint != NULL) {
                        error = EBUSY;
                        break;



Home | Main Index | Thread Index | Old Index