after the "struct disk" is finished with, it should be

destroyed with disk_destroy(9) to stave off LOCKDEBUG
panics.
This commit is contained in:
plunky 2008-05-03 08:23:41 +00:00
parent 49716be5e2
commit fcf1772a80
4 changed files with 12 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: xbd.c,v 1.44 2008/04/16 18:41:48 cegger Exp $ */
/* $NetBSD: xbd.c,v 1.45 2008/05/03 08:23:41 plunky Exp $ */
/*
*
@ -33,7 +33,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xbd.c,v 1.44 2008/04/16 18:41:48 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: xbd.c,v 1.45 2008/05/03 08:23:41 plunky Exp $");
#include "xbd_hypervisor.h"
#include "rnd.h"
@ -1199,6 +1199,7 @@ xbd_detach(device_t dv, int flags)
/* Detach the disk. */
disk_detach(&xs->sc_dksc.sc_dkdev);
disk_destroy(&xs->sc_dksc.sc_dkdev);
#if NRND > 0
/* Unhook the entropy source. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: xbd_xenbus.c,v 1.26 2008/04/16 18:41:48 cegger Exp $ */
/* $NetBSD: xbd_xenbus.c,v 1.27 2008/05/03 08:23:41 plunky Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.26 2008/04/16 18:41:48 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.27 2008/05/03 08:23:41 plunky Exp $");
#include "opt_xen.h"
#include "rnd.h"
@ -283,6 +283,7 @@ xbd_xenbus_detach(device_t dev, int flags)
/* detach disk */
disk_detach(&sc->sc_dksc.sc_dkdev);
disk_destroy(&sc->sc_dksc.sc_dkdev);
}
event_remove_handler(sc->sc_evtchn, &xbd_handler, sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: dk.c,v 1.38 2008/04/28 20:23:48 martin Exp $ */
/* $NetBSD: dk.c,v 1.39 2008/05/03 08:23:41 plunky 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.38 2008/04/28 20:23:48 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.39 2008/05/03 08:23:41 plunky Exp $");
#include "opt_dkwedge.h"
@ -506,6 +506,7 @@ dkwedge_del(struct dkwedge_info *dkw)
/* Detach from the disk list. */
disk_detach(&sc->sc_dk);
disk_destroy(&sc->sc_dk);
/* Poof. */
rw_enter(&dkwedges_lock, RW_WRITER);

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.86 2008/04/30 23:02:43 ad Exp $ */
/* $NetBSD: fd.c,v 1.87 2008/05/03 08:23:41 plunky Exp $ */
/*-
* Copyright (c) 1998, 2003, 2008 The NetBSD Foundation, Inc.
@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.86 2008/04/30 23:02:43 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.87 2008/05/03 08:23:41 plunky Exp $");
#include "rnd.h"
#include "opt_ddb.h"
@ -612,6 +612,7 @@ fddetach(device_t self, int flags)
#endif
disk_detach(&fd->sc_dk);
disk_destroy(&fd->sc_dk);
/* Kill off any queued buffers. */
bufq_drain(fd->sc_q);