Received: by 10.213.65.68 with SMTP id h4csp145230imn; Thu, 15 Mar 2018 12:13:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELvOcHi+OZE8U8ensgIKv6zPaqOCfSblQ2RE0u6ewDT9MB7cY6wpXlUTiNS5YJJzGKEPtk32 X-Received: by 2002:a17:902:41:: with SMTP id 59-v6mr9460772pla.248.1521141221478; Thu, 15 Mar 2018 12:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521141221; cv=none; d=google.com; s=arc-20160816; b=mJSBIh4r20Uhtz7oeO3/ld5ClVEP/dfpW7CA8kIVtcOF9sX0h/qEos0YWVLWymYhir BAxFBiJjpjVezF8x8KlLd33gm+0BxB6DIThPHPG/VjIXZSwk4kU84iRSEM5obmd9XNXt y1sNC4m+TlxWqB8lHV+dAuik2CUtkyOao9bzy0dfdPsD0CZ0y2UoVWc4CN6IEovQnbV1 MhIjSnJdrWyDyh/pjXSBfOq1ABZ3I0x+we3IdeUlFpT/Z2NZAN8YJr2LUKu6UuTXB8hG CXgsoqG4ILz3X+dWHDGfxKDvywpAnOC4MT7G1HXFhxch4EXaMrSRsO+sC0callEVJf0e 8OLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=0qQL5Nuri2qSVodz4ZfRr1gRNZFl9TWENvQwZIll3QM=; b=0C4iZ5hCYdRwItwxNSsduV9eRPH8kpkC3PgColIdqtbvUXRysicjMqFy9yWnVRoQ1T TFsA0ML/HRe1zXBXs5iJ43OuO5A0Zbj5evD1iVnT2khApgTYRvpR7YCUVeDk2CJ+VYX4 ZAZv6fpc1aasnk2hPNs45TlZ7yw3AJXYaJdrdOMdhrKjRGmMGXmp4Rg5Y1EmW4OHmGzU BhThZTDo8utl7nSpwvVs7hAfZKiQksz3XH5IwUIGTSJXXcheHTs7wHmqivb56iWcQDU5 ESCh+6EKG+s2yCSIR0H7YiD0gqBIDpeICGAbcnbuAFp39jwIsLCy/icRbbwWZ+Kow7UW 25rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si4398536ple.162.2018.03.15.12.13.26; Thu, 15 Mar 2018 12:13:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752742AbeCOTLt (ORCPT + 99 others); Thu, 15 Mar 2018 15:11:49 -0400 Received: from isilmar-4.linta.de ([136.243.71.142]:36076 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932630AbeCOTGW (ORCPT ); Thu, 15 Mar 2018 15:06:22 -0400 Received: from light.dominikbrodowski.net (isilmar.linta [10.0.0.1]) by isilmar-4.linta.de (Postfix) with ESMTPS id A19D720091F; Thu, 15 Mar 2018 19:06:18 +0000 (UTC) Received: by light.dominikbrodowski.net (Postfix, from userid 1000) id CEEE52060E; Thu, 15 Mar 2018 20:05:38 +0100 (CET) From: Dominik Brodowski To: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, viro@zeniv.linux.org.uk Cc: luto@kernel.org, mingo@kernel.org, akpm@linux-foundation.org, arnd@arndb.de Subject: [PATCH v2 09/36] syscalls: add do_epoll_*() helpers; remove internal calls to sys_epoll_*() Date: Thu, 15 Mar 2018 20:05:02 +0100 Message-Id: <20180315190529.20943-10-linux@dominikbrodowski.net> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180315190529.20943-1-linux@dominikbrodowski.net> References: <20180315190529.20943-1-linux@dominikbrodowski.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using the helper functions do_epoll_create() and do_epoll_wait() allows us to remove in-kernel calls to the related syscall functions. Cc: Alexander Viro Signed-off-by: Dominik Brodowski --- fs/eventpoll.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 0f3494ed3ed0..602ca4285b2e 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1936,7 +1936,7 @@ static void clear_tfile_check_list(void) /* * Open an eventpoll file descriptor. */ -SYSCALL_DEFINE1(epoll_create1, int, flags) +static int do_epoll_create(int flags) { int error, fd; struct eventpoll *ep = NULL; @@ -1979,12 +1979,17 @@ SYSCALL_DEFINE1(epoll_create1, int, flags) return error; } +SYSCALL_DEFINE1(epoll_create1, int, flags) +{ + return do_epoll_create(flags); +} + SYSCALL_DEFINE1(epoll_create, int, size) { if (size <= 0) return -EINVAL; - return sys_epoll_create1(0); + return do_epoll_create(0); } /* @@ -2148,8 +2153,8 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, * Implement the event wait interface for the eventpoll file. It is the kernel * part of the user space epoll_wait(2). */ -SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events, - int, maxevents, int, timeout) +static int do_epoll_wait(int epfd, struct epoll_event __user *events, + int maxevents, int timeout) { int error; struct fd f; @@ -2190,6 +2195,12 @@ SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events, return error; } +SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events, + int, maxevents, int, timeout) +{ + return do_epoll_wait(epfd, events, maxevents, timeout); +} + /* * Implement the event wait interface for the eventpoll file. It is the kernel * part of the user space epoll_pwait(2). @@ -2214,7 +2225,7 @@ SYSCALL_DEFINE6(epoll_pwait, int, epfd, struct epoll_event __user *, events, set_current_blocked(&ksigmask); } - error = sys_epoll_wait(epfd, events, maxevents, timeout); + error = do_epoll_wait(epfd, events, maxevents, timeout); /* * If we changed the signal mask, we need to restore the original one. @@ -2257,7 +2268,7 @@ COMPAT_SYSCALL_DEFINE6(epoll_pwait, int, epfd, set_current_blocked(&ksigmask); } - err = sys_epoll_wait(epfd, events, maxevents, timeout); + err = do_epoll_wait(epfd, events, maxevents, timeout); /* * If we changed the signal mask, we need to restore the original one. -- 2.16.2