Commit 4f72816e authored by Simon Horman's avatar Simon Horman Committed by David S. Miller

IPVS: convert __ip_vs_securetcp_lock to a spinlock

Also rename __ip_vs_securetcp_lock to ip_vs_securetcp_lock.

Spinlock conversion was suggested by Eric Dumazet.
Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bd144550
...@@ -61,7 +61,7 @@ static DEFINE_RWLOCK(__ip_vs_svc_lock); ...@@ -61,7 +61,7 @@ static DEFINE_RWLOCK(__ip_vs_svc_lock);
static DEFINE_RWLOCK(__ip_vs_rs_lock); static DEFINE_RWLOCK(__ip_vs_rs_lock);
/* lock for state and timeout tables */ /* lock for state and timeout tables */
static DEFINE_RWLOCK(__ip_vs_securetcp_lock); static DEFINE_SPINLOCK(ip_vs_securetcp_lock);
/* lock for drop entry handling */ /* lock for drop entry handling */
static DEFINE_SPINLOCK(__ip_vs_dropentry_lock); static DEFINE_SPINLOCK(__ip_vs_dropentry_lock);
...@@ -204,7 +204,7 @@ static void update_defense_level(void) ...@@ -204,7 +204,7 @@ static void update_defense_level(void)
spin_unlock(&__ip_vs_droppacket_lock); spin_unlock(&__ip_vs_droppacket_lock);
/* secure_tcp */ /* secure_tcp */
write_lock(&__ip_vs_securetcp_lock); spin_lock(&ip_vs_securetcp_lock);
switch (sysctl_ip_vs_secure_tcp) { switch (sysctl_ip_vs_secure_tcp) {
case 0: case 0:
if (old_secure_tcp >= 2) if (old_secure_tcp >= 2)
...@@ -238,7 +238,7 @@ static void update_defense_level(void) ...@@ -238,7 +238,7 @@ static void update_defense_level(void)
old_secure_tcp = sysctl_ip_vs_secure_tcp; old_secure_tcp = sysctl_ip_vs_secure_tcp;
if (to_change >= 0) if (to_change >= 0)
ip_vs_protocol_timeout_change(sysctl_ip_vs_secure_tcp>1); ip_vs_protocol_timeout_change(sysctl_ip_vs_secure_tcp>1);
write_unlock(&__ip_vs_securetcp_lock); spin_unlock(&ip_vs_securetcp_lock);
local_bh_enable(); local_bh_enable();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment