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/ipv6/ipcomp6.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/ipv6/ipcomp6.c')
-rw-r--r-- | net/ipv6/ipcomp6.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index 6107592fbd8c..3c7b324cd20c 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <net/protocol.h> | 50 | #include <net/protocol.h> |
51 | #include <linux/ipv6.h> | 51 | #include <linux/ipv6.h> |
52 | #include <linux/icmpv6.h> | 52 | #include <linux/icmpv6.h> |
53 | #include <linux/mutex.h> | ||
53 | 54 | ||
54 | struct ipcomp6_tfms { | 55 | struct ipcomp6_tfms { |
55 | struct list_head list; | 56 | struct list_head list; |
@@ -57,7 +58,7 @@ struct ipcomp6_tfms { | |||
57 | int users; | 58 | int users; |
58 | }; | 59 | }; |
59 | 60 | ||
60 | static DECLARE_MUTEX(ipcomp6_resource_sem); | 61 | static DEFINE_MUTEX(ipcomp6_resource_mutex); |
61 | static void **ipcomp6_scratches; | 62 | static void **ipcomp6_scratches; |
62 | static int ipcomp6_scratch_users; | 63 | static int ipcomp6_scratch_users; |
63 | static LIST_HEAD(ipcomp6_tfms_list); | 64 | static LIST_HEAD(ipcomp6_tfms_list); |
@@ -405,9 +406,9 @@ static void ipcomp6_destroy(struct xfrm_state *x) | |||
405 | if (!ipcd) | 406 | if (!ipcd) |
406 | return; | 407 | return; |
407 | xfrm_state_delete_tunnel(x); | 408 | xfrm_state_delete_tunnel(x); |
408 | down(&ipcomp6_resource_sem); | 409 | mutex_lock(&ipcomp6_resource_mutex); |
409 | ipcomp6_free_data(ipcd); | 410 | ipcomp6_free_data(ipcd); |
410 | up(&ipcomp6_resource_sem); | 411 | mutex_unlock(&ipcomp6_resource_mutex); |
411 | kfree(ipcd); | 412 | kfree(ipcd); |
412 | 413 | ||
413 | xfrm6_tunnel_free_spi((xfrm_address_t *)&x->props.saddr); | 414 | xfrm6_tunnel_free_spi((xfrm_address_t *)&x->props.saddr); |
@@ -436,14 +437,14 @@ static int ipcomp6_init_state(struct xfrm_state *x) | |||
436 | if (x->props.mode) | 437 | if (x->props.mode) |
437 | x->props.header_len += sizeof(struct ipv6hdr); | 438 | x->props.header_len += sizeof(struct ipv6hdr); |
438 | 439 | ||
439 | down(&ipcomp6_resource_sem); | 440 | mutex_lock(&ipcomp6_resource_mutex); |
440 | if (!ipcomp6_alloc_scratches()) | 441 | if (!ipcomp6_alloc_scratches()) |
441 | goto error; | 442 | goto error; |
442 | 443 | ||
443 | ipcd->tfms = ipcomp6_alloc_tfms(x->calg->alg_name); | 444 | ipcd->tfms = ipcomp6_alloc_tfms(x->calg->alg_name); |
444 | if (!ipcd->tfms) | 445 | if (!ipcd->tfms) |
445 | goto error; | 446 | goto error; |
446 | up(&ipcomp6_resource_sem); | 447 | mutex_unlock(&ipcomp6_resource_mutex); |
447 | 448 | ||
448 | if (x->props.mode) { | 449 | if (x->props.mode) { |
449 | err = ipcomp6_tunnel_attach(x); | 450 | err = ipcomp6_tunnel_attach(x); |
@@ -459,10 +460,10 @@ static int ipcomp6_init_state(struct xfrm_state *x) | |||
459 | out: | 460 | out: |
460 | return err; | 461 | return err; |
461 | error_tunnel: | 462 | error_tunnel: |
462 | down(&ipcomp6_resource_sem); | 463 | mutex_lock(&ipcomp6_resource_mutex); |
463 | error: | 464 | error: |
464 | ipcomp6_free_data(ipcd); | 465 | ipcomp6_free_data(ipcd); |
465 | up(&ipcomp6_resource_sem); | 466 | mutex_unlock(&ipcomp6_resource_mutex); |
466 | kfree(ipcd); | 467 | kfree(ipcd); |
467 | 468 | ||
468 | goto out; | 469 | goto out; |