]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/unix/af_unix.c
Merge with /home/shaggy/git/linus-clean/
[linux-2.6-omap-h63xx.git] / net / unix / af_unix.c
index 7d3fe6aebcdb24774d71f439cffe17d4460b5143..c323cc6a28b0e3f6042058879ead5dd9d5d36aaa 100644 (file)
@@ -547,7 +547,7 @@ static struct sock * unix_create1(struct socket *sock)
        struct sock *sk = NULL;
        struct unix_sock *u;
 
-       if (atomic_read(&unix_nr_socks) >= 2*files_stat.max_files)
+       if (atomic_read(&unix_nr_socks) >= 2*get_max_files())
                goto out;
 
        sk = sk_alloc(PF_UNIX, GFP_KERNEL, &unix_proto, 1);
@@ -564,7 +564,7 @@ static struct sock * unix_create1(struct socket *sock)
        u         = unix_sk(sk);
        u->dentry = NULL;
        u->mnt    = NULL;
-       rwlock_init(&u->lock);
+       spin_lock_init(&u->lock);
        atomic_set(&u->inflight, sock ? 0 : -1);
        init_MUTEX(&u->readsem); /* single task reading lock */
        init_waitqueue_head(&u->peer_wait);
@@ -784,7 +784,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
                err = vfs_mknod(nd.dentry->d_inode, dentry, mode, 0);
                if (err)
                        goto out_mknod_dput;
-               up(&nd.dentry->d_inode->i_sem);
+               mutex_unlock(&nd.dentry->d_inode->i_mutex);
                dput(nd.dentry);
                nd.dentry = dentry;
 
@@ -823,7 +823,7 @@ out:
 out_mknod_dput:
        dput(dentry);
 out_mknod_unlock:
-       up(&nd.dentry->d_inode->i_sem);
+       mutex_unlock(&nd.dentry->d_inode->i_mutex);
        path_release(&nd);
 out_mknod_parent:
        if (err==-EEXIST)
@@ -1859,7 +1859,7 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                }
 
                default:
-                       err = dev_ioctl(cmd, (void __user *)arg);
+                       err = -ENOIOCTLCMD;
                        break;
        }
        return err;