]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/socket.c
net: use this_cpu_xxx replace percpu_xxx funcs
[karo-tx-linux.git] / net / socket.c
index 484cc6953fc61ebcb049604e5dbdb57a4ffcd385..08e873ac16094ff3307c45b44bf6da5c2a6bb969 100644 (file)
@@ -479,7 +479,7 @@ static struct socket *sock_alloc(void)
        inode->i_uid = current_fsuid();
        inode->i_gid = current_fsgid();
 
-       percpu_add(sockets_in_use, 1);
+       this_cpu_add(sockets_in_use, 1);
        return sock;
 }
 
@@ -522,7 +522,7 @@ 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");
 
-       percpu_sub(sockets_in_use, 1);
+       this_cpu_sub(sockets_in_use, 1);
        if (!sock->file) {
                iput(SOCK_INODE(sock));
                return;
@@ -811,9 +811,9 @@ static ssize_t sock_sendpage(struct file *file, struct page *page,
 
        sock = file->private_data;
 
-       flags = !(file->f_flags & O_NONBLOCK) ? 0 : MSG_DONTWAIT;
-       if (more)
-               flags |= MSG_MORE;
+       flags = (file->f_flags & O_NONBLOCK) ? MSG_DONTWAIT : 0;
+       /* more is a combination of MSG_MORE and MSG_SENDPAGE_NOTLAST */
+       flags |= more;
 
        return kernel_sendpage(sock, page, offset, size, flags);
 }