fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / net / ipv4 / ipvs / ip_vs_est.c
index 3af1fd1..7d68b80 100644 (file)
  *
  */
 #include <linux/kernel.h>
+#include <linux/jiffies.h>
+#include <linux/slab.h>
 #include <linux/types.h>
+#include <linux/interrupt.h>
 
 #include <net/ip_vs.h>
 
@@ -62,7 +65,7 @@ struct ip_vs_estimator
 
 
 static struct ip_vs_estimator *est_list = NULL;
-static rwlock_t est_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(est_lock);
 static struct timer_list est_timer;
 
 static void estimation_timer(unsigned long arg)
@@ -120,11 +123,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;