]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/unix/garbage.c
[BRIDGE]: Unaligned accesses in the ethernet bridge
[linux-2.6-omap-h63xx.git] / net / unix / garbage.c
index 6ffc64e1712d291f40723109db1a774e507c738c..746c2f4a5fa62a290418a0b7780b165678ae7f96 100644 (file)
@@ -76,6 +76,7 @@
 #include <linux/netdevice.h>
 #include <linux/file.h>
 #include <linux/proc_fs.h>
+#include <linux/mutex.h>
 
 #include <net/sock.h>
 #include <net/af_unix.h>
@@ -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);
 }