X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=net%2Funix%2Fgarbage.c;h=746c2f4a5fa62a290418a0b7780b165678ae7f96;hb=271f18f102c789f59644bb6c53a69da1df72b2f4;hp=6ffc64e1712d291f40723109db1a774e507c738c;hpb=288ceb8f142249109fd2e9f1bf0492bd6ff6d892;p=powerpc.git diff --git a/net/unix/garbage.c b/net/unix/garbage.c index 6ffc64e171..746c2f4a5f 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c @@ -76,6 +76,7 @@ #include #include #include +#include #include #include @@ -169,7 +170,7 @@ static void maybe_unmark_and_push(struct sock *x) void unix_gc(void) { - static DECLARE_MUTEX(unix_gc_sem); + static DEFINE_MUTEX(unix_gc_sem); int i; struct sock *s; struct sk_buff_head hitlist; @@ -179,10 +180,10 @@ void unix_gc(void) * Avoid a recursive GC. */ - if (down_trylock(&unix_gc_sem)) + if (!mutex_trylock(&unix_gc_sem)) return; - read_lock(&unix_table_lock); + spin_lock(&unix_table_lock); forall_unix_sockets(i, s) { @@ -301,12 +302,12 @@ void unix_gc(void) } u->gc_tree = GC_ORPHAN; } - read_unlock(&unix_table_lock); + spin_unlock(&unix_table_lock); /* * Here we are. Hitlist is filled. Die. */ __skb_queue_purge(&hitlist); - up(&unix_gc_sem); + mutex_unlock(&unix_gc_sem); }