]> Pileus Git - ~andy/linux/blobdiff - net/socket.c
Revert "mm/sl[aou]b: Move sysfs_slab_add to common"
[~andy/linux] / net / socket.c
index 6e0ccc09b3131112bce0970ca91d5032545b3772..dfe5b66c97e0bc836efed43ad080dec620301306 100644 (file)
@@ -398,7 +398,7 @@ int sock_map_fd(struct socket *sock, int flags)
 }
 EXPORT_SYMBOL(sock_map_fd);
 
-static struct socket *sock_from_file(struct file *file, int *err)
+struct socket *sock_from_file(struct file *file, int *err)
 {
        if (file->f_op == &socket_file_ops)
                return file->private_data;      /* set in sock_map_fd */
@@ -406,6 +406,7 @@ static struct socket *sock_from_file(struct file *file, int *err)
        *err = -ENOTSOCK;
        return NULL;
 }
+EXPORT_SYMBOL(sock_from_file);
 
 /**
  *     sockfd_lookup - Go from a file number to its socket slot
@@ -522,6 +523,9 @@ void sock_release(struct socket *sock)
        if (rcu_dereference_protected(sock->wq, 1)->fasync_list)
                printk(KERN_ERR "sock_release: fasync list not empty!\n");
 
+       if (test_bit(SOCK_EXTERNALLY_ALLOCATED, &sock->flags))
+               return;
+
        this_cpu_sub(sockets_in_use, 1);
        if (!sock->file) {
                iput(SOCK_INODE(sock));
@@ -551,8 +555,6 @@ static inline int __sock_sendmsg_nosec(struct kiocb *iocb, struct socket *sock,
 
        sock_update_classid(sock->sk);
 
-       sock_update_netprioidx(sock->sk);
-
        si->sock = sock;
        si->scm = NULL;
        si->msg = msg;