struct sock *unix_get_socket(struct file *filp);
 struct sock *unix_peer_get(struct sock *sk);
 
-#define UNIX_HASH_SIZE 256
+#define UNIX_HASH_MOD  (256 - 1)
+#define UNIX_HASH_SIZE (256 * 2)
 #define UNIX_HASH_BITS 8
 
 extern unsigned int unix_tot_inflight;
-extern spinlock_t unix_table_locks[2 * UNIX_HASH_SIZE];
-extern struct hlist_head unix_socket_table[2 * UNIX_HASH_SIZE];
+extern spinlock_t unix_table_locks[UNIX_HASH_SIZE];
+extern struct hlist_head unix_socket_table[UNIX_HASH_SIZE];
 
 struct unix_address {
        refcount_t      refcnt;
 
 
 #include "scm.h"
 
-spinlock_t unix_table_locks[2 * UNIX_HASH_SIZE];
+spinlock_t unix_table_locks[UNIX_HASH_SIZE];
 EXPORT_SYMBOL_GPL(unix_table_locks);
-struct hlist_head unix_socket_table[2 * UNIX_HASH_SIZE];
+struct hlist_head unix_socket_table[UNIX_HASH_SIZE];
 EXPORT_SYMBOL_GPL(unix_socket_table);
 static atomic_long_t unix_nr_socks;
 
        hash ^= hash >> 8;
        hash ^= sk->sk_type;
 
-       return UNIX_HASH_SIZE + (hash & (UNIX_HASH_SIZE - 1));
+       return UNIX_HASH_MOD + 1 + (hash & UNIX_HASH_MOD);
 }
 
 static unsigned int unix_bsd_hash(struct inode *i)
 {
-       return i->i_ino & (UNIX_HASH_SIZE - 1);
+       return i->i_ino & UNIX_HASH_MOD;
 }
 
 static unsigned int unix_abstract_hash(struct sockaddr_un *sunaddr,
        hash ^= hash >> 8;
        hash ^= type;
 
-       return hash & (UNIX_HASH_SIZE - 1);
+       return hash & UNIX_HASH_MOD;
 }
 
 static void unix_table_double_lock(unsigned int hash1, unsigned int hash2)
 {
        /* hash1 and hash2 is never the same because
-        * one is between 0 and UNIX_HASH_SIZE - 1, and
-        * another is between UNIX_HASH_SIZE and UNIX_HASH_SIZE * 2.
+        * one is between 0 and UNIX_HASH_MOD, and
+        * another is between UNIX_HASH_MOD + 1 and UNIX_HASH_SIZE - 1.
         */
        if (hash1 > hash2)
                swap(hash1, hash2);
        unsigned long bucket = get_bucket(*pos);
        struct sock *sk;
 
-       while (bucket < ARRAY_SIZE(unix_socket_table)) {
+       while (bucket < UNIX_HASH_SIZE) {
                spin_lock(&unix_table_locks[bucket]);
 
                sk = unix_from_bucket(seq, pos);
 
        BUILD_BUG_ON(sizeof(struct unix_skb_parms) > sizeof_field(struct sk_buff, cb));
 
-       for (i = 0; i < 2 * UNIX_HASH_SIZE; i++)
+       for (i = 0; i < UNIX_HASH_SIZE; i++)
                spin_lock_init(&unix_table_locks[i]);
 
        rc = proto_register(&unix_dgram_proto, 1);
 
        s_slot = cb->args[0];
        num = s_num = cb->args[1];
 
-       for (slot = s_slot;
-            slot < ARRAY_SIZE(unix_socket_table);
-            s_num = 0, slot++) {
+       for (slot = s_slot; slot < UNIX_HASH_SIZE; s_num = 0, slot++) {
                struct sock *sk;
 
                num = 0;
        struct sock *sk;
        int i;
 
-       for (i = 0; i < ARRAY_SIZE(unix_socket_table); i++) {
+       for (i = 0; i < UNIX_HASH_SIZE; i++) {
                spin_lock(&unix_table_locks[i]);
                sk_for_each(sk, &unix_socket_table[i])
                        if (ino == sock_i_ino(sk)) {