Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/dkwedge dk(4): Turn locking contract comment into as...



details:   https://anonhg.NetBSD.org/src/rev/4b48ac902383
branches:  trunk
changeset: 369571:4b48ac902383
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 22 00:19:53 2022 +0000

description:
dk(4): Turn locking contract comment into assertions in dklastclose.

diffstat:

 sys/dev/dkwedge/dk.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (37 lines):

diff -r 0cc2346d602e -r 4b48ac902383 sys/dev/dkwedge/dk.c
--- a/sys/dev/dkwedge/dk.c      Mon Aug 22 00:19:43 2022 +0000
+++ b/sys/dev/dkwedge/dk.c      Mon Aug 22 00:19:53 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dk.c,v 1.116 2022/08/22 00:19:43 riastradh Exp $       */
+/*     $NetBSD: dk.c,v 1.117 2022/08/22 00:19:53 riastradh 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.116 2022/08/22 00:19:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.117 2022/08/22 00:19:53 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dkwedge.h"
@@ -1199,15 +1199,15 @@
        return (error);
 }
 
-/*
- * Caller must hold sc->sc_dk.dk_openlock and sc->sc_parent->dk_rawlock.
- */
 static int
 dklastclose(struct dkwedge_softc *sc)
 {
        struct vnode *vp;
        int error = 0, mode;
 
+       KASSERT(mutex_owned(&sc->sc_dk.dk_openlock));
+       KASSERT(mutex_owned(&sc->sc_parent->dk_rawlock));
+
        mode = sc->sc_mode;
 
        vp = NULL;



Home | Main Index | Thread Index | Old Index