Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Since the minor numbers belonging to the partitions ...



details:   https://anonhg.NetBSD.org/src/rev/40b820ef5477
branches:  trunk
changeset: 526686:40b820ef5477
user:      drochner <drochner%NetBSD.org@localhost>
date:      Wed May 08 15:49:07 2002 +0000

description:
Since the minor numbers belonging to the partitions of a disk are not
contigous anymore, we can't call vdevgone() for the whole range at once.
(we should probably change the vdevgone() interface)
This also fixes some wrong use of DISKUNIT().

diffstat:

 sys/dev/ld.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (44 lines):

diff -r 0f57b9deeb2b -r 40b820ef5477 sys/dev/ld.c
--- a/sys/dev/ld.c      Wed May 08 15:32:58 2002 +0000
+++ b/sys/dev/ld.c      Wed May 08 15:49:07 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ld.c,v 1.12 2001/11/13 05:32:50 lukem Exp $    */
+/*     $NetBSD: ld.c,v 1.13 2002/05/08 15:49:07 drochner Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.12 2001/11/13 05:32:50 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.13 2002/05/08 15:49:07 drochner Exp $");
 
 #include "rnd.h"
 
@@ -174,7 +174,7 @@
 ldenddetach(struct ld_softc *sc)
 {
        struct buf *bp;
-       int s, bmaj, cmaj, mn;
+       int s, bmaj, cmaj, i, mn;
 
        if ((sc->sc_flags & LDF_ENABLED) == 0)
                return;
@@ -204,10 +204,12 @@
        splx(s);
 
        /* Nuke the vnodes for any open instances. */
-       mn = DISKUNIT(sc->sc_dv.dv_unit);
-       vdevgone(bmaj, mn, mn + (MAXPARTITIONS - 1), VBLK);
-       vdevgone(cmaj, mn, mn + (MAXPARTITIONS - 1), VCHR);
-       
+       for (i = 0; i < MAXPARTITIONS; i++) {
+               mn = DISKMINOR(sc->sc_dv.dv_unit, i);
+               vdevgone(bmaj, mn, mn, VBLK);
+               vdevgone(cmaj, mn, mn, VCHR);
+       }
+
        /* Detach from the disk list. */
        disk_detach(&sc->sc_dk);
 



Home | Main Index | Thread Index | Old Index