From patchwork Thu Mar 22 09:00:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominik Brodowski X-Patchwork-Id: 10301021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0117760386 for ; Thu, 22 Mar 2018 09:03:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB60F29A7F for ; Thu, 22 Mar 2018 09:03:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0416290E5; Thu, 22 Mar 2018 09:03:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76A44290E5 for ; Thu, 22 Mar 2018 09:03:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753229AbeCVJCH (ORCPT ); Thu, 22 Mar 2018 05:02:07 -0400 Received: from isilmar-4.linta.de ([136.243.71.142]:37686 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752848AbeCVJBx (ORCPT ); Thu, 22 Mar 2018 05:01:53 -0400 Received: from light.dominikbrodowski.net (isilmar.linta [10.0.0.1]) by isilmar-4.linta.de (Postfix) with ESMTPS id 7EC5A200939; Thu, 22 Mar 2018 09:01:37 +0000 (UTC) Received: by light.dominikbrodowski.net (Postfix, from userid 1000) id F10E320DAE; Thu, 22 Mar 2018 10:01:10 +0100 (CET) From: Dominik Brodowski To: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, viro@ZenIV.linux.org.uk, arnd@arndb.de, linux-arch@vger.kernel.org Cc: Jan Kara , Amir Goldstein , linux-fsdevel@vger.kernel.org Subject: [PATCH 16/45] inotify: add do_inotify_init() helper; remove in-kernel call to syscall Date: Thu, 22 Mar 2018 10:00:30 +0100 Message-Id: <20180322090059.19361-17-linux@dominikbrodowski.net> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180322090059.19361-1-linux@dominikbrodowski.net> References: <20180322090059.19361-1-linux@dominikbrodowski.net> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using the inotify-internal do_inotify_init() helper allows us to get rid of the in-kernel call to sys_inotify_init1() syscall. This patch is part of a series which tries to remove in-kernel calls to syscalls. On this basis, the syscall entry path can be streamlined. Cc: Jan Kara Cc: Amir Goldstein Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Dominik Brodowski Acked-by: Jan Kara --- fs/notify/inotify/inotify_user.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 2c908b31d6c9..43c23653ce2e 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c @@ -635,7 +635,7 @@ static struct fsnotify_group *inotify_new_group(unsigned int max_events) /* inotify syscalls */ -SYSCALL_DEFINE1(inotify_init1, int, flags) +static int do_inotify_init(int flags) { struct fsnotify_group *group; int ret; @@ -660,9 +660,14 @@ SYSCALL_DEFINE1(inotify_init1, int, flags) return ret; } +SYSCALL_DEFINE1(inotify_init1, int, flags) +{ + return do_inotify_init(flags); +} + SYSCALL_DEFINE0(inotify_init) { - return sys_inotify_init1(0); + return do_inotify_init(0); } SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,