diff options
author | scottl <scottl@FreeBSD.org> | 2007-05-10 15:33:41 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2007-05-10 15:33:41 +0000 |
commit | c1f92f9a266a46d212d75d17c49062fcd72a88b1 (patch) | |
tree | 0b192bdf920c7ff1fa9073529fd2c7ef9ca382e6 /sys/dev/mfi/mfi_pci.c | |
parent | ced6c23397bb86d97c036e35c740110c6cab4599 (diff) | |
download | FreeBSD-src-c1f92f9a266a46d212d75d17c49062fcd72a88b1.zip FreeBSD-src-c1f92f9a266a46d212d75d17c49062fcd72a88b1.tar.gz |
Collapse the mfi_ld object. Add an ioctl to help management apps map
array Id's to FreeBSD device names.
Diffstat (limited to 'sys/dev/mfi/mfi_pci.c')
-rw-r--r-- | sys/dev/mfi/mfi_pci.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/mfi/mfi_pci.c b/sys/dev/mfi/mfi_pci.c index ebd1fef..ccec1d0 100644 --- a/sys/dev/mfi/mfi_pci.c +++ b/sys/dev/mfi/mfi_pci.c @@ -195,21 +195,23 @@ static int mfi_pci_detach(device_t dev) { struct mfi_softc *sc; - struct mfi_ld *ld; + struct mfi_disk *ld; int error; sc = device_get_softc(dev); - if ((sc->mfi_flags & MFI_FLAGS_OPEN) != 0) + mtx_lock(&sc->mfi_io_lock); + if ((sc->mfi_flags & MFI_FLAGS_OPEN) != 0) { + mtx_unlock(&sc->mfi_io_lock); return (EBUSY); + } - while ((ld = TAILQ_FIRST(&sc->mfi_ld_tqh)) != NULL) { - error = device_delete_child(dev, ld->ld_disk); - if (error) + while ((ld = TAILQ_FIRST(&sc->mfi_ld_tqh)) != NULL) { + if ((error = device_delete_child(dev, ld->ld_dev)) != 0) { + mtx_unlock(&sc->mfi_io_lock); return (error); + } TAILQ_REMOVE(&sc->mfi_ld_tqh, ld, ld_link); - free(ld->ld_info, M_MFIBUF); - free(ld, M_MFIBUF); } EVENTHANDLER_DEREGISTER(shutdown_final, sc->mfi_eh); |