Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/dkwedge Clear sc_mode only on last close.



details:   https://anonhg.NetBSD.org/src/rev/722e26fdab88
branches:  trunk
changeset: 1021517:722e26fdab88
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Wed Jun 02 17:56:40 2021 +0000

description:
Clear sc_mode only on last close.

diffstat:

 sys/dev/dkwedge/dk.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r b521bc1d0ddd -r 722e26fdab88 sys/dev/dkwedge/dk.c
--- a/sys/dev/dkwedge/dk.c      Wed Jun 02 16:07:33 2021 +0000
+++ b/sys/dev/dkwedge/dk.c      Wed Jun 02 17:56:40 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dk.c,v 1.104 2021/06/02 15:59:08 mlelstv Exp $ */
+/*     $NetBSD: dk.c,v 1.105 2021/06/02 17:56:40 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.104 2021/06/02 15:59:08 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.105 2021/06/02 17:56:40 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dkwedge.h"
@@ -1221,6 +1221,7 @@
                        KASSERT(sc->sc_parent->dk_rawvp != NULL);
                        vp = sc->sc_parent->dk_rawvp;
                        sc->sc_parent->dk_rawvp = NULL;
+                       sc->sc_mode = 0;
                }
        }
 
@@ -1264,9 +1265,7 @@
 
        if (sc->sc_dk.dk_openmask == 0) {
                error = dklastclose(sc); /* releases locks */
-               sc->sc_mode = 0;
        } else {
-               sc->sc_mode = 0;
                mutex_exit(&sc->sc_parent->dk_rawlock);
                mutex_exit(&sc->sc_dk.dk_openlock);
        }



Home | Main Index | Thread Index | Old Index