]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: socket: replace call to sys_recv() with __sys_recvfrom()
authorDominik Brodowski <linux@dominikbrodowski.net>
Tue, 13 Mar 2018 18:54:17 +0000 (19:54 +0100)
committerDominik Brodowski <linux@dominikbrodowski.net>
Mon, 2 Apr 2018 18:15:16 +0000 (20:15 +0200)
sys_recv() merely expands the parameters to __sys_recvfrom() by NULL and
NULL. Open-code this in the two places which used sys_recv() as a wrapper
to __sys_recvfrom().

This patch is part of a series which removes in-kernel calls to syscalls.
On this basis, the syscall entry path can be streamlined. For details, see
http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
net/compat.c
net/socket.c

index d55982ff5c5905db46a4c905fc90d04872314b20..9e0d030063ad6635ea4daaf9fb2776c98e113007 100644 (file)
@@ -755,7 +755,8 @@ COMPAT_SYSCALL_DEFINE3(recvmsg, int, fd, struct compat_msghdr __user *, msg, uns
 
 COMPAT_SYSCALL_DEFINE4(recv, int, fd, void __user *, buf, compat_size_t, len, unsigned int, flags)
 {
-       return sys_recv(fd, buf, len, flags | MSG_CMSG_COMPAT);
+       return __sys_recvfrom(fd, buf, len, flags | MSG_CMSG_COMPAT, NULL,
+                             NULL);
 }
 
 COMPAT_SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, buf, compat_size_t, len,
index 92de21bb1a2ee0866081890df469d29646e821e0..03702f08aa62616eabc6c724d6f7cfd1a9e0e8fc 100644 (file)
@@ -2566,7 +2566,8 @@ SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args)
                                   (struct sockaddr __user *)a[4], a[5]);
                break;
        case SYS_RECV:
-               err = sys_recv(a0, (void __user *)a1, a[2], a[3]);
+               err = __sys_recvfrom(a0, (void __user *)a1, a[2], a[3],
+                                    NULL, NULL);
                break;
        case SYS_RECVFROM:
                err = __sys_recvfrom(a0, (void __user *)a1, a[2], a[3],