]> err.no Git - linux-2.6/blobdiff - net/ipv4/ipvs/ip_vs_est.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6] / net / ipv4 / ipvs / ip_vs_est.c
index c453e1e57f4bdd758b1210395c5447560bee3fc8..bc04eedd6dbb45b26853f3c39e9323c9a41900c4 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * ip_vs_est.c: simple rate estimator for IPVS
  *
- * Version:     $Id: ip_vs_est.c,v 1.4 2002/11/30 01:50:35 wensong Exp $
- *
  * Authors:     Wensong Zhang <wensong@linuxvirtualserver.org>
  *
  *              This program is free software; you can redistribute it and/or
  * Changes:
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/jiffies.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/interrupt.h>
+#include <linux/sysctl.h>
 
 #include <net/ip_vs.h>
 
@@ -124,11 +122,10 @@ int ip_vs_new_estimator(struct ip_vs_stats *stats)
 {
        struct ip_vs_estimator *est;
 
-       est = kmalloc(sizeof(*est), GFP_KERNEL);
+       est = kzalloc(sizeof(*est), GFP_KERNEL);
        if (est == NULL)
                return -ENOMEM;
 
-       memset(est, 0, sizeof(*est));
        est->stats = stats;
        est->last_conns = stats->conns;
        est->cps = stats->cps<<10;
@@ -148,9 +145,8 @@ int ip_vs_new_estimator(struct ip_vs_stats *stats)
        write_lock_bh(&est_lock);
        est->next = est_list;
        if (est->next == NULL) {
-               init_timer(&est_timer);
+               setup_timer(&est_timer, estimation_timer, 0);
                est_timer.expires = jiffies + 2*HZ;
-               est_timer.function = estimation_timer;
                add_timer(&est_timer);
        }
        est_list = est;