} __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)
* 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",
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
}
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);