aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-03-21 01:35:41 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-21 01:35:41 -0500
commit57b47a53ec4a67691ba32cff5768e8d78fa6c67f (patch)
treed735ae4734f7b386eefa508a0629715f45808d1d /net/netfilter
parent6613f82dd293b23f582a649b287fadbf8d23e6cf (diff)
[NET]: sem2mutex part 2
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> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nf_conntrack_core.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index dc68d0022218..f6498234e264 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -185,7 +185,7 @@ static struct {
185DEFINE_RWLOCK(nf_ct_cache_lock); 185DEFINE_RWLOCK(nf_ct_cache_lock);
186 186
187/* This avoids calling kmem_cache_create() with same name simultaneously */ 187/* This avoids calling kmem_cache_create() with same name simultaneously */
188DECLARE_MUTEX(nf_ct_cache_mutex); 188static DEFINE_MUTEX(nf_ct_cache_mutex);
189 189
190extern struct nf_conntrack_protocol nf_conntrack_generic_protocol; 190extern struct nf_conntrack_protocol nf_conntrack_generic_protocol;
191struct nf_conntrack_protocol * 191struct nf_conntrack_protocol *
@@ -278,7 +278,7 @@ int nf_conntrack_register_cache(u_int32_t features, const char *name,
278 return -EINVAL; 278 return -EINVAL;
279 } 279 }
280 280
281 down(&nf_ct_cache_mutex); 281 mutex_lock(&nf_ct_cache_mutex);
282 282
283 write_lock_bh(&nf_ct_cache_lock); 283 write_lock_bh(&nf_ct_cache_lock);
284 /* e.g: multiple helpers are loaded */ 284 /* e.g: multiple helpers are loaded */
@@ -294,7 +294,7 @@ int nf_conntrack_register_cache(u_int32_t features, const char *name,
294 ret = -EBUSY; 294 ret = -EBUSY;
295 295
296 write_unlock_bh(&nf_ct_cache_lock); 296 write_unlock_bh(&nf_ct_cache_lock);
297 up(&nf_ct_cache_mutex); 297 mutex_unlock(&nf_ct_cache_mutex);
298 return ret; 298 return ret;
299 } 299 }
300 write_unlock_bh(&nf_ct_cache_lock); 300 write_unlock_bh(&nf_ct_cache_lock);
@@ -338,7 +338,7 @@ int nf_conntrack_register_cache(u_int32_t features, const char *name,
338out_free_name: 338out_free_name:
339 kfree(cache_name); 339 kfree(cache_name);
340out_up_mutex: 340out_up_mutex:
341 up(&nf_ct_cache_mutex); 341 mutex_unlock(&nf_ct_cache_mutex);
342 return ret; 342 return ret;
343} 343}
344 344
@@ -353,12 +353,12 @@ void nf_conntrack_unregister_cache(u_int32_t features)
353 * slab cache. 353 * slab cache.
354 */ 354 */
355 DEBUGP("nf_conntrack_unregister_cache: 0x%04x\n", features); 355 DEBUGP("nf_conntrack_unregister_cache: 0x%04x\n", features);
356 down(&nf_ct_cache_mutex); 356 mutex_lock(&nf_ct_cache_mutex);
357 357
358 write_lock_bh(&nf_ct_cache_lock); 358 write_lock_bh(&nf_ct_cache_lock);
359 if (--nf_ct_cache[features].use > 0) { 359 if (--nf_ct_cache[features].use > 0) {
360 write_unlock_bh(&nf_ct_cache_lock); 360 write_unlock_bh(&nf_ct_cache_lock);
361 up(&nf_ct_cache_mutex); 361 mutex_unlock(&nf_ct_cache_mutex);
362 return; 362 return;
363 } 363 }
364 cachep = nf_ct_cache[features].cachep; 364 cachep = nf_ct_cache[features].cachep;
@@ -373,7 +373,7 @@ void nf_conntrack_unregister_cache(u_int32_t features)
373 kmem_cache_destroy(cachep); 373 kmem_cache_destroy(cachep);
374 kfree(name); 374 kfree(name);
375 375
376 up(&nf_ct_cache_mutex); 376 mutex_unlock(&nf_ct_cache_mutex);
377} 377}
378 378
379int 379int
@@ -1408,6 +1408,8 @@ void __nf_ct_refresh_acct(struct nf_conn *ct,
1408 1408
1409#include <linux/netfilter/nfnetlink.h> 1409#include <linux/netfilter/nfnetlink.h>
1410#include <linux/netfilter/nfnetlink_conntrack.h> 1410#include <linux/netfilter/nfnetlink_conntrack.h>
1411#include <linux/mutex.h>
1412
1411 1413
1412/* Generic function for tcp/udp/sctp/dccp and alike. This needs to be 1414/* Generic function for tcp/udp/sctp/dccp and alike. This needs to be
1413 * in ip_conntrack_core, since we don't want the protocols to autoload 1415 * in ip_conntrack_core, since we don't want the protocols to autoload