diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-03-21 01:33:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 01:33:17 -0500 |
commit | 4a3e2f711a00a1feb72ae12fdc749da10179d185 (patch) | |
tree | 76ced9d3270dea4b864da71fa1d4415d2e3c8b11 /net/ipv4/xfrm4_tunnel.c | |
parent | d4ccd08cdfa8d34f4d25b62041343c52fc79385f (diff) |
[NET] sem2mutex: net/
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/xfrm4_tunnel.c')
-rw-r--r-- | net/ipv4/xfrm4_tunnel.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c index afbb0d4cc305..b08d56b117f8 100644 --- a/net/ipv4/xfrm4_tunnel.c +++ b/net/ipv4/xfrm4_tunnel.c | |||
@@ -5,6 +5,7 @@ | |||
5 | 5 | ||
6 | #include <linux/skbuff.h> | 6 | #include <linux/skbuff.h> |
7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
8 | #include <linux/mutex.h> | ||
8 | #include <net/xfrm.h> | 9 | #include <net/xfrm.h> |
9 | #include <net/ip.h> | 10 | #include <net/ip.h> |
10 | #include <net/protocol.h> | 11 | #include <net/protocol.h> |
@@ -26,19 +27,19 @@ static int ipip_xfrm_rcv(struct xfrm_state *x, struct xfrm_decap_state *decap, s | |||
26 | } | 27 | } |
27 | 28 | ||
28 | static struct xfrm_tunnel *ipip_handler; | 29 | static struct xfrm_tunnel *ipip_handler; |
29 | static DECLARE_MUTEX(xfrm4_tunnel_sem); | 30 | static DEFINE_MUTEX(xfrm4_tunnel_mutex); |
30 | 31 | ||
31 | int xfrm4_tunnel_register(struct xfrm_tunnel *handler) | 32 | int xfrm4_tunnel_register(struct xfrm_tunnel *handler) |
32 | { | 33 | { |
33 | int ret; | 34 | int ret; |
34 | 35 | ||
35 | down(&xfrm4_tunnel_sem); | 36 | mutex_lock(&xfrm4_tunnel_mutex); |
36 | ret = 0; | 37 | ret = 0; |
37 | if (ipip_handler != NULL) | 38 | if (ipip_handler != NULL) |
38 | ret = -EINVAL; | 39 | ret = -EINVAL; |
39 | if (!ret) | 40 | if (!ret) |
40 | ipip_handler = handler; | 41 | ipip_handler = handler; |
41 | up(&xfrm4_tunnel_sem); | 42 | mutex_unlock(&xfrm4_tunnel_mutex); |
42 | 43 | ||
43 | return ret; | 44 | return ret; |
44 | } | 45 | } |
@@ -49,13 +50,13 @@ int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler) | |||
49 | { | 50 | { |
50 | int ret; | 51 | int ret; |
51 | 52 | ||
52 | down(&xfrm4_tunnel_sem); | 53 | mutex_lock(&xfrm4_tunnel_mutex); |
53 | ret = 0; | 54 | ret = 0; |
54 | if (ipip_handler != handler) | 55 | if (ipip_handler != handler) |
55 | ret = -EINVAL; | 56 | ret = -EINVAL; |
56 | if (!ret) | 57 | if (!ret) |
57 | ipip_handler = NULL; | 58 | ipip_handler = NULL; |
58 | up(&xfrm4_tunnel_sem); | 59 | mutex_unlock(&xfrm4_tunnel_mutex); |
59 | 60 | ||
60 | synchronize_net(); | 61 | synchronize_net(); |
61 | 62 | ||