amr(4): Some bugfixes.
authorSascha Wildner <saw@online.de>
Sat, 11 Dec 2010 03:57:36 +0000 (04:57 +0100)
committerSascha Wildner <saw@online.de>
Sat, 11 Dec 2010 04:57:45 +0000 (05:57 +0100)
* Add a missing devstat_end_transaction_buf(). Makes device stats actually
  work.

* Add a couple of missing cam_simq_release() calls.

sys/dev/raid/amr/amr_cam.c
sys/dev/raid/amr/amr_disk.c

index ed5da50..ae42daf 100644 (file)
@@ -174,6 +174,7 @@ amr_cam_attach(device_t dev)
                if ((sc->amr_cam_sim[chn] = cam_sim_alloc(amr_cam_action,
                    amr_cam_poll, "amr", sc, device_get_unit(sc->amr_dev),
                    &sc->amr_list_lock, 1, AMR_MAX_SCSI_CMDS, devq)) == NULL) {
+                       cam_simq_release(devq);
                        device_printf(sc->amr_dev, "CAM SIM attach failed\n");
                        return(ENOMEM);
                }
@@ -218,6 +219,10 @@ amr_cam_detach(device_t dev)
        }
        lockmgr(&sc->amr_list_lock, LK_RELEASE);
 
+       /* Now free the devq */
+       if (sc->amr_cam_devq != NULL)
+               cam_simq_release(sc->amr_cam_devq);
+
        return (0);
 }
 
index a1df430..4043b74 100644 (file)
@@ -200,9 +200,11 @@ amrd_intr(void *data)
 {
     struct bio *bio = (struct bio *)data;
     struct buf *bp = bio->bio_buf;
+    struct amrd_softc *sc = (struct amrd_softc *)bio->bio_driver_info;
 
     debug_called(2);
 
+    devstat_end_transaction_buf(&sc->amrd_stats, bp);
     if (bp->b_flags & B_ERROR) {
        bp->b_error = EIO;
        debug(1, "i/o error\n");