aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/garbage.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/unix/garbage.c')
-rw-r--r--net/unix/garbage.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/unix/garbage.c b/net/unix/garbage.c
index 411802bd4d37..746c2f4a5fa6 100644
--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -76,6 +76,7 @@
76#include <linux/netdevice.h> 76#include <linux/netdevice.h>
77#include <linux/file.h> 77#include <linux/file.h>
78#include <linux/proc_fs.h> 78#include <linux/proc_fs.h>
79#include <linux/mutex.h>
79 80
80#include <net/sock.h> 81#include <net/sock.h>
81#include <net/af_unix.h> 82#include <net/af_unix.h>
@@ -169,7 +170,7 @@ static void maybe_unmark_and_push(struct sock *x)
169 170
170void unix_gc(void) 171void unix_gc(void)
171{ 172{
172 static DECLARE_MUTEX(unix_gc_sem); 173 static DEFINE_MUTEX(unix_gc_sem);
173 int i; 174 int i;
174 struct sock *s; 175 struct sock *s;
175 struct sk_buff_head hitlist; 176 struct sk_buff_head hitlist;
@@ -179,7 +180,7 @@ void unix_gc(void)
179 * Avoid a recursive GC. 180 * Avoid a recursive GC.
180 */ 181 */
181 182
182 if (down_trylock(&unix_gc_sem)) 183 if (!mutex_trylock(&unix_gc_sem))
183 return; 184 return;
184 185
185 spin_lock(&unix_table_lock); 186 spin_lock(&unix_table_lock);
@@ -308,5 +309,5 @@ void unix_gc(void)
308 */ 309 */
309 310
310 __skb_queue_purge(&hitlist); 311 __skb_queue_purge(&hitlist);
311 up(&unix_gc_sem); 312 mutex_unlock(&unix_gc_sem);
312} 313}