fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / net / unix / af_unix.c
index bcda09e..64bf00f 100644 (file)
 #include <net/checksum.h>
 #include <linux/security.h>
 #include <linux/vs_context.h>
-#include <linux/vs_network.h>
 #include <linux/vs_limit.h>
 
-int sysctl_unix_max_dgram_qlen = 10;
+int sysctl_unix_max_dgram_qlen __read_mostly = 10;
 
 struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1];
 DEFINE_SPINLOCK(unix_table_lock);
@@ -154,8 +153,9 @@ static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
  *    each socket state is protected by separate rwlock.
  */
 
-static inline unsigned unix_hash_fold(unsigned hash)
+static inline unsigned unix_hash_fold(__wsum n)
 {
+       unsigned hash = (__force unsigned)n;
        hash ^= hash>>16;
        hash ^= hash>>8;
        return hash&(UNIX_HASH_SIZE-1);
@@ -255,7 +255,7 @@ static struct sock *__unix_find_socket_byname(struct sockaddr_un *sunname,
        sk_for_each(s, node, &unix_socket_table[hash ^ type]) {
                struct unix_sock *u = unix_sk(s);
 
-               if (!vx_check(s->sk_xid, VX_IDENT|VX_WATCH))
+               if (!nx_check(s->sk_nid, VS_WATCH_P|VS_IDENT))
                        continue;
                if (u->addr->len == len &&
                    !memcmp(u->addr->name, sunname, len))
@@ -2065,10 +2065,7 @@ static int __init af_unix_init(void)
        int rc = -1;
        struct sk_buff *dummy_skb;
 
-       if (sizeof(struct unix_skb_parms) > sizeof(dummy_skb->cb)) {
-               printk(KERN_CRIT "%s: panic\n", __FUNCTION__);
-               goto out;
-       }
+       BUILD_BUG_ON(sizeof(struct unix_skb_parms) > sizeof(dummy_skb->cb));
 
        rc = proto_register(&unix_proto, 1);
         if (rc != 0) {