linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / net / sched / sch_htb.c
index 880a339..3ec95df 100644 (file)
@@ -27,6 +27,7 @@
  *
  * $Id: sch_htb.c,v 1.25 2003/12/07 11:08:25 devik Exp devik $
  */
+#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -196,7 +197,7 @@ struct htb_class
     struct qdisc_rate_table *rate;     /* rate table of the class itself */
     struct qdisc_rate_table *ceil;     /* ceiling rate (limits borrows too) */
     long buffer,cbuffer;               /* token bucket depth/rate */
-    psched_tdiff_t mbuffer;            /* max wait time */
+    long mbuffer;                      /* max wait time */
     long tokens,ctokens;               /* current number of tokens */
     psched_time_t t_c;                 /* checkpoint time */
 };
@@ -1559,9 +1560,10 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
                        goto failure;
                }
                err = -ENOBUFS;
-               if ((cl = kzalloc(sizeof(*cl), GFP_KERNEL)) == NULL)
+               if ((cl = kmalloc(sizeof(*cl), GFP_KERNEL)) == NULL)
                        goto failure;
                
+               memset(cl, 0, sizeof(*cl));
                cl->refcnt = 1;
                INIT_LIST_HEAD(&cl->sibling);
                INIT_LIST_HEAD(&cl->hlist);
@@ -1600,7 +1602,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
                /* set class to be in HTB_CAN_SEND state */
                cl->tokens = hopt->buffer;
                cl->ctokens = hopt->cbuffer;
-               cl->mbuffer = PSCHED_JIFFIE2US(HZ*60); /* 1min */
+               cl->mbuffer = 60000000; /* 1min */
                PSCHED_GET_TIME(cl->t_c);
                cl->cmode = HTB_CAN_SEND;