timeout/untimeout ==> callout_*
authorJoerg Sonnenberger <joerg@dragonflybsd.org>
Fri, 17 Sep 2004 02:20:53 +0000 (02:20 +0000)
committerJoerg Sonnenberger <joerg@dragonflybsd.org>
Fri, 17 Sep 2004 02:20:53 +0000 (02:20 +0000)
sys/bus/cam/cam_sim.c
sys/bus/cam/cam_sim.h
sys/bus/cam/cam_xpt.c

index ca48a32..ab6da57 100644 (file)
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/cam/cam_sim.c,v 1.3 1999/08/28 00:40:42 peter Exp $
- * $DragonFly: src/sys/bus/cam/cam_sim.c,v 1.6 2004/03/15 01:10:30 dillon Exp $
+ * $DragonFly: src/sys/bus/cam/cam_sim.c,v 1.7 2004/09/17 02:20:53 joerg Exp $
  */
 
 #include <sys/param.h>
@@ -95,7 +95,7 @@ cam_sim_alloc(sim_action_func sim_action, sim_poll_func sim_poll,
        sim->max_dev_openings = max_dev_transactions;
        sim->flags = 0;
        sim->refcount = 1;
-       callout_handle_init(&sim->c_handle);
+       callout_init(&sim->c_handle);
        sim->devq = queue;
 
        return (sim);
index 91dd56e..3b81610 100644 (file)
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/cam/cam_sim.h,v 1.4 1999/12/29 04:54:27 peter Exp $
- * $DragonFly: src/sys/bus/cam/cam_sim.h,v 1.4 2004/03/15 01:10:30 dillon Exp $
+ * $DragonFly: src/sys/bus/cam/cam_sim.h,v 1.5 2004/09/17 02:20:53 joerg Exp $
  */
 
 #ifndef _CAM_CAM_SIM_H
@@ -102,7 +102,7 @@ struct cam_sim {
        int                     max_dev_openings;
        u_int32_t               flags;
 #define                CAM_SIM_REL_TIMEOUT_PENDING     0x01
-       struct callout_handle   c_handle;
+       struct callout          c_handle;
        struct cam_devq         *devq;  /* Device Queue to use for this SIM */
        int                     refcount;       /* References to the sim */
 };
index 295a04e..d66ef8c 100644 (file)
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/cam/cam_xpt.c,v 1.80.2.18 2002/12/09 17:31:55 gibbs Exp $
- * $DragonFly: src/sys/bus/cam/cam_xpt.c,v 1.15 2004/05/19 22:52:37 dillon Exp $
+ * $DragonFly: src/sys/bus/cam/cam_xpt.c,v 1.16 2004/09/17 02:20:53 joerg Exp $
  */
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -148,7 +148,7 @@ struct cam_ed {
        u_int32_t        tag_delay_count;
 #define        CAM_TAG_DELAY_COUNT             5
        u_int32_t        refcount;
-       struct           callout_handle c_handle;
+       struct           callout c_handle;
 };
 
 /*
@@ -3259,17 +3259,15 @@ xpt_action(union ccb *start_ccb)
                                 * is sufficient for releasing the queue.
                                 */
                                start_ccb->ccb_h.flags &= ~CAM_DEV_QFREEZE;
-                               untimeout(xpt_release_devq_timeout,
-                                         dev, dev->c_handle);
+                               callout_stop(&dev->c_handle);
                        } else {
 
                                start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE;
                        }
 
-                       dev->c_handle =
-                               timeout(xpt_release_devq_timeout,
-                                       dev,
-                                       (crs->release_timeout * hz) / 1000);
+                       callout_reset(&dev->c_handle,
+                                     (crs->release_timeout * hz) / 1000, 
+                                     xpt_release_devq_timeout, dev);
 
                        dev->flags |= CAM_DEV_REL_TIMEOUT_PENDING;
 
@@ -4474,8 +4472,7 @@ xpt_release_devq_device(struct cam_ed *dev, u_int count, int run_queue)
                         * to release this queue.
                         */
                        if ((dev->flags & CAM_DEV_REL_TIMEOUT_PENDING) != 0) {
-                               untimeout(xpt_release_devq_timeout, dev,
-                                         dev->c_handle);
+                               callout_stop(&dev->c_handle);
                                dev->flags &= ~CAM_DEV_REL_TIMEOUT_PENDING;
                        }
 
@@ -4517,8 +4514,7 @@ xpt_release_simq(struct cam_sim *sim, int run_queue)
                         * already at 0.
                         */
                        if ((sim->flags & CAM_SIM_REL_TIMEOUT_PENDING) != 0){
-                               untimeout(xpt_release_simq_timeout, sim,
-                                         sim->c_handle);
+                               callout_stop(&sim->c_handle);
                                sim->flags &= ~CAM_SIM_REL_TIMEOUT_PENDING;
                        }
                        bus = xpt_find_bus(sim->path_id);
@@ -4750,7 +4746,7 @@ xpt_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id)
                device->flags = CAM_DEV_UNCONFIGURED;
                device->tag_delay_count = 0;
                device->refcount = 1;
-               callout_handle_init(&device->c_handle);
+               callout_init(&device->c_handle);
 
                /*
                 * Hold a reference to our parent target so it
@@ -4799,8 +4795,7 @@ xpt_release_device(struct cam_eb *bus, struct cam_et *target,
 
                if ((device->flags & CAM_DEV_REL_TIMEOUT_PENDING) != 0) {
                        device->flags &= ~CAM_DEV_REL_TIMEOUT_PENDING;
-                       untimeout(xpt_release_devq_timeout, device,
-                                 device->c_handle);
+                       callout_stop(&device->c_handle);
                }
 
                TAILQ_REMOVE(&target->ed_entries, device,links);