aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipvs
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-03-26 04:37:14 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 11:56:55 -0500
commit14cc3e2b633bb64063698980974df4535368e98f (patch)
treed542c9db7376de199d640b8e34d5630460b217b5 /net/ipv4/ipvs
parent353ab6e97b8f209dbecc9f650f1f84e3da2a7bb1 (diff)
[PATCH] sem2mutex: misc static one-file mutexes
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Dave Jones <davej@codemonkey.org.uk> Cc: Paul Mackerras <paulus@samba.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Jens Axboe <axboe@suse.de> Cc: Neil Brown <neilb@cse.unsw.edu.au> Acked-by: Alasdair G Kergon <agk@redhat.com> Cc: Greg KH <greg@kroah.com> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: Adam Belay <ambx1@neo.rr.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/ipv4/ipvs')
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 7f0288b25fa1..f28ec6882162 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -34,6 +34,7 @@
34 34
35#include <linux/netfilter.h> 35#include <linux/netfilter.h>
36#include <linux/netfilter_ipv4.h> 36#include <linux/netfilter_ipv4.h>
37#include <linux/mutex.h>
37 38
38#include <net/ip.h> 39#include <net/ip.h>
39#include <net/route.h> 40#include <net/route.h>
@@ -44,7 +45,7 @@
44#include <net/ip_vs.h> 45#include <net/ip_vs.h>
45 46
46/* semaphore for IPVS sockopts. And, [gs]etsockopt may sleep. */ 47/* semaphore for IPVS sockopts. And, [gs]etsockopt may sleep. */
47static DECLARE_MUTEX(__ip_vs_mutex); 48static DEFINE_MUTEX(__ip_vs_mutex);
48 49
49/* lock for service table */ 50/* lock for service table */
50static DEFINE_RWLOCK(__ip_vs_svc_lock); 51static DEFINE_RWLOCK(__ip_vs_svc_lock);
@@ -1950,7 +1951,7 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
1950 /* increase the module use count */ 1951 /* increase the module use count */
1951 ip_vs_use_count_inc(); 1952 ip_vs_use_count_inc();
1952 1953
1953 if (down_interruptible(&__ip_vs_mutex)) { 1954 if (mutex_lock_interruptible(&__ip_vs_mutex)) {
1954 ret = -ERESTARTSYS; 1955 ret = -ERESTARTSYS;
1955 goto out_dec; 1956 goto out_dec;
1956 } 1957 }
@@ -2041,7 +2042,7 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
2041 ip_vs_service_put(svc); 2042 ip_vs_service_put(svc);
2042 2043
2043 out_unlock: 2044 out_unlock:
2044 up(&__ip_vs_mutex); 2045 mutex_unlock(&__ip_vs_mutex);
2045 out_dec: 2046 out_dec:
2046 /* decrease the module use count */ 2047 /* decrease the module use count */
2047 ip_vs_use_count_dec(); 2048 ip_vs_use_count_dec();
@@ -2211,7 +2212,7 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
2211 if (copy_from_user(arg, user, get_arglen[GET_CMDID(cmd)]) != 0) 2212 if (copy_from_user(arg, user, get_arglen[GET_CMDID(cmd)]) != 0)
2212 return -EFAULT; 2213 return -EFAULT;
2213 2214
2214 if (down_interruptible(&__ip_vs_mutex)) 2215 if (mutex_lock_interruptible(&__ip_vs_mutex))
2215 return -ERESTARTSYS; 2216 return -ERESTARTSYS;
2216 2217
2217 switch (cmd) { 2218 switch (cmd) {
@@ -2330,7 +2331,7 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
2330 } 2331 }
2331 2332
2332 out: 2333 out:
2333 up(&__ip_vs_mutex); 2334 mutex_unlock(&__ip_vs_mutex);
2334 return ret; 2335 return ret;
2335} 2336}
2336 2337