X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fipv4%2Fipvs%2Fip_vs_conn.c;h=fd6feb5499fe486ac32b61e61150b28529b60ae5;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=52969f3156be428e4f3cab0f95cbb2a654ac29ca;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c index 52969f315..fd6feb549 100644 --- a/net/ipv4/ipvs/ip_vs_conn.c +++ b/net/ipv4/ipvs/ip_vs_conn.c @@ -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);