vserver 1.9.5.x5
[linux-2.6.git] / net / ipv4 / ipvs / ip_vs_conn.c
index 52969f3..fd6feb5 100644 (file)
@@ -64,7 +64,7 @@ struct ip_vs_aligned_lock
 } __attribute__((__aligned__(SMP_CACHE_BYTES)));
 
 /* lock array for conn table */
-struct ip_vs_aligned_lock
+static struct ip_vs_aligned_lock
 __ip_vs_conntbl_lock_array[CT_LOCKARRAY_SIZE] __cacheline_aligned;
 
 static inline void ct_read_lock(unsigned key)
@@ -453,7 +453,9 @@ int ip_vs_check_template(struct ip_vs_conn *ct)
         * Checking the dest server status.
         */
        if ((dest == NULL) ||
-           !(dest->flags & IP_VS_DEST_F_AVAILABLE)) {
+           !(dest->flags & IP_VS_DEST_F_AVAILABLE) || 
+           (sysctl_ip_vs_expire_quiescent_template && 
+            (atomic_read(&dest->weight) == 0))) {
                IP_VS_DBG(9, "check_template: dest not available for "
                          "protocol %s s:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d "
                          "-> d:%u.%u.%u.%u:%d\n",
@@ -580,7 +582,7 @@ ip_vs_conn_new(int proto, __u32 caddr, __u16 cport, __u32 vaddr, __u16 vport,
        cp->daddr          = daddr;
        cp->dport          = dport;
        cp->flags          = flags;
-       cp->lock           = SPIN_LOCK_UNLOCKED;
+       spin_lock_init(&cp->lock);
 
        /*
         * Set the entry is referenced by the current thread before hashing
@@ -894,7 +896,7 @@ int ip_vs_conn_init(void)
        }
 
        for (idx = 0; idx < CT_LOCKARRAY_SIZE; idx++)  {
-               __ip_vs_conntbl_lock_array[idx].l = RW_LOCK_UNLOCKED;
+               rwlock_init(&__ip_vs_conntbl_lock_array[idx].l);
        }
 
        proc_net_fops_create("ip_vs_conn", 0, &ip_vs_conn_fops);