From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D660AC433EF for ; Wed, 24 Nov 2021 09:44:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 245476E222; Wed, 24 Nov 2021 09:44:13 +0000 (UTC) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 262AB6E222; Wed, 24 Nov 2021 09:44:12 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 57BF02193C; Wed, 24 Nov 2021 09:44:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1637747050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xjctS9e3aLk//fWwNzII/UY4G5OnovggWZdyEKD1t34=; b=Fa3DfqPoxkPRyFtLFipUAPsRoQ7583RIvIkjGcirn+ZDIVuZJxTkgHZCWQWJkaYcgx/XTF 6Tg+qvMREmzgGwP+y0PqF0I8yljZj0emBD/1N75E2fyVfhSwuHdlW27Cq87y3T4+dKDpTg m3CDIAdfVxCay7j/D++92R/TIMACYbw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1637747050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xjctS9e3aLk//fWwNzII/UY4G5OnovggWZdyEKD1t34=; b=jBk0LyCfiE1g4jR+z/f8PsVbXLRirmoGyBWY3eutEhQ8eC54ZtfGnQdZjQkRNSqRSaajn0 YL6WjUHTxaO0ZHAA== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id A4AA0A3B8E; Wed, 24 Nov 2021 09:44:09 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 844E41E14AC; Wed, 24 Nov 2021 10:44:09 +0100 (CET) Date: Wed, 24 Nov 2021 10:44:09 +0100 From: Jan Kara To: Luis Chamberlain Message-ID: <20211124094409.GF8583@quack2.suse.cz> References: <20211123202422.819032-1-mcgrof@kernel.org> <20211123202422.819032-7-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211123202422.819032-7-mcgrof@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [Intel-gfx] [PATCH v2 6/8] inotify: simplify subdirectory registration with register_sysctl() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jack@suse.cz, airlied@linux.ie, benh@kernel.crashing.org, amir73il@gmail.com, clemens@ladisch.de, dri-devel@lists.freedesktop.org, phil@philpotter.co.uk, joseph.qi@linux.alibaba.com, mark@fasheh.com, yzaikin@google.com, keescook@chromium.org, arnd@arndb.de, intel-gfx@lists.freedesktop.org, viro@zeniv.linux.org.uk, nixiaoming@huawei.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, julia.lawall@inria.fr, ebiederm@xmission.com, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, ocfs2-devel@oss.oracle.com, jlbec@evilplan.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue 23-11-21 12:24:20, Luis Chamberlain wrote: > From: Xiaoming Ni > > There is no need to user boiler plate code to specify a set of base > directories we're going to stuff sysctls under. Simplify this by using > register_sysctl() and specifying the directory path directly. > > Move inotify_user sysctl to inotify_user.c while at it to remove clutter > from kernel/sysctl.c. > > Signed-off-by: Xiaoming Ni > [mcgrof: update commit log to reflect new path we decided to take] > Signed-off-by: Luis Chamberlain This looks fishy. You register inotify_table but not fanotify_table and remove both... Honza > --- > fs/notify/inotify/inotify_user.c | 11 ++++++++++- > include/linux/inotify.h | 3 --- > kernel/sysctl.c | 21 --------------------- > 3 files changed, 10 insertions(+), 25 deletions(-) > > diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c > index 29fca3284bb5..54583f62dc44 100644 > --- a/fs/notify/inotify/inotify_user.c > +++ b/fs/notify/inotify/inotify_user.c > @@ -58,7 +58,7 @@ struct kmem_cache *inotify_inode_mark_cachep __read_mostly; > static long it_zero = 0; > static long it_int_max = INT_MAX; > > -struct ctl_table inotify_table[] = { > +static struct ctl_table inotify_table[] = { > { > .procname = "max_user_instances", > .data = &init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES], > @@ -87,6 +87,14 @@ struct ctl_table inotify_table[] = { > }, > { } > }; > + > +static void __init inotify_sysctls_init(void) > +{ > + register_sysctl("fs/inotify", inotify_table); > +} > + > +#else > +#define inotify_sysctls_init() do { } while (0) > #endif /* CONFIG_SYSCTL */ > > static inline __u32 inotify_arg_to_mask(struct inode *inode, u32 arg) > @@ -849,6 +857,7 @@ static int __init inotify_user_setup(void) > inotify_max_queued_events = 16384; > init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES] = 128; > init_user_ns.ucount_max[UCOUNT_INOTIFY_WATCHES] = watches_max; > + inotify_sysctls_init(); > > return 0; > } > diff --git a/include/linux/inotify.h b/include/linux/inotify.h > index 6a24905f6e1e..8d20caa1b268 100644 > --- a/include/linux/inotify.h > +++ b/include/linux/inotify.h > @@ -7,11 +7,8 @@ > #ifndef _LINUX_INOTIFY_H > #define _LINUX_INOTIFY_H > > -#include > #include > > -extern struct ctl_table inotify_table[]; /* for sysctl */ > - > #define ALL_INOTIFY_BITS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ > IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \ > IN_MOVED_TO | IN_CREATE | IN_DELETE | \ > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index 7a90a12b9ea4..6aa67c737e4e 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -125,13 +125,6 @@ static const int maxolduid = 65535; > static const int ngroups_max = NGROUPS_MAX; > static const int cap_last_cap = CAP_LAST_CAP; > > -#ifdef CONFIG_INOTIFY_USER > -#include > -#endif > -#ifdef CONFIG_FANOTIFY > -#include > -#endif > - > #ifdef CONFIG_PROC_SYSCTL > > /** > @@ -3099,20 +3092,6 @@ static struct ctl_table fs_table[] = { > .proc_handler = proc_dointvec, > }, > #endif > -#ifdef CONFIG_INOTIFY_USER > - { > - .procname = "inotify", > - .mode = 0555, > - .child = inotify_table, > - }, > -#endif > -#ifdef CONFIG_FANOTIFY > - { > - .procname = "fanotify", > - .mode = 0555, > - .child = fanotify_table, > - }, > -#endif > #ifdef CONFIG_EPOLL > { > .procname = "epoll", > -- > 2.33.0 > -- Jan Kara SUSE Labs, CR From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aib29ajc250.phx1.oracleemaildelivery.com (aib29ajc250.phx1.oracleemaildelivery.com [192.29.103.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C4E8BC433F5 for ; Wed, 24 Nov 2021 09:44:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=bhNAzp03MSwDikd/3E2/49iHPI9uEItw44ZO4VSlzjM=; b=eNmq+sq/3BDXjnHhVm8QBJfWf+gxVAZW1smH1Owt7EZNNKZwsBMBpQqSiIW+drvgMTBtsPrwd/4b JlfK/UPLw3ZPowcvp+CfMuC3DmbZwnyvRVq5W6ZSCpxFeGR+cLWKwwMGVewYuB1dBm2NrFo2wFiZ pEuRxd7OSdLdlXJexYsq8db2ADJRCwCYyRPsrZr8ueJwTq0d8Srut0VLPuRI019lPgLYGWEVd1/Y AvyJTL1ZxhE1m3QfYqyDb1F1YFrxhlDIadBvSneQzBBDyrG85APHLsJyB/P8ft4O9OpmUcnIVgne /WtifnG4GnxtyWxAz+AgpWiODiYz7QBc5pGkjQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=bhNAzp03MSwDikd/3E2/49iHPI9uEItw44ZO4VSlzjM=; b=rsidpqzi4TJvV+6fBvYx/uh57OZ6MpI12RZInUdgBNEtt/6FRD1pTzyTRj/VH/3340w33uk4Hq4P eFG5GhTAucWdcG+Sy79ZSQUMVw1eUZfvkRqqO4I7/LOfPIKM7IvhF9BHAcqLGSgvCnFKghGqHWr8 LgXWMIxFd9fp5mA7IeicLItPelZ8g0+Wo02fxNV1caKg2s8GJnBcxZybtn9z49qFqdL8UotW6iOY ydoyQuq3VVyBj1vlbXIDysrHh246sMHiJoRqqtWq4LXlKOtjsY2uHmGSFQ9Y2Bo+860Uu1rr0jUM 4XSMd90Y/57PD8D8E/Ura/dRr0K0yr+/xP0Pog== Received: by omta-ad2-fd3-201-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20211026 64bit (built Oct 26 2021)) with ESMTP id <0R32001LWLQ73PF0@omta-ad2-fd3-201-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Wed, 24 Nov 2021 09:44:31 +0000 (GMT) Authentication-results: aserp3010.oracle.com; spf=softfail smtp.mailfrom=jack@suse.cz; dkim=pass header.d=suse.cz header.s=susede2_rsa; dkim=permerror header.d=suse.cz header.s=susede2_ed25519; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1637747050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xjctS9e3aLk//fWwNzII/UY4G5OnovggWZdyEKD1t34=; b=Fa3DfqPoxkPRyFtLFipUAPsRoQ7583RIvIkjGcirn+ZDIVuZJxTkgHZCWQWJkaYcgx/XTF 6Tg+qvMREmzgGwP+y0PqF0I8yljZj0emBD/1N75E2fyVfhSwuHdlW27Cq87y3T4+dKDpTg m3CDIAdfVxCay7j/D++92R/TIMACYbw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1637747050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xjctS9e3aLk//fWwNzII/UY4G5OnovggWZdyEKD1t34=; b=jBk0LyCfiE1g4jR+z/f8PsVbXLRirmoGyBWY3eutEhQ8eC54ZtfGnQdZjQkRNSqRSaajn0 YL6WjUHTxaO0ZHAA== Date: Wed, 24 Nov 2021 10:44:09 +0100 To: Luis Chamberlain Message-id: <20211124094409.GF8583@quack2.suse.cz> References: <20211123202422.819032-1-mcgrof@kernel.org> <20211123202422.819032-7-mcgrof@kernel.org> MIME-version: 1.0 Content-disposition: inline In-reply-to: <20211123202422.819032-7-mcgrof@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Source-IP: 195.135.220.28 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10177 signatures=668683 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 impostorscore=0 spamscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxlogscore=898 suspectscore=0 clxscore=299 bulkscore=0 lowpriorityscore=0 mlxscore=0 priorityscore=270 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111240054 Cc: jack@suse.cz, airlied@linux.ie, benh@kernel.crashing.org, amir73il@gmail.com, clemens@ladisch.de, dri-devel@lists.freedesktop.org, phil@philpotter.co.uk, yzaikin@google.com, joonas.lahtinen@linux.intel.com, keescook@chromium.org, arnd@arndb.de, intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com, viro@zeniv.linux.org.uk, rodrigo.vivi@intel.com, nixiaoming@huawei.com, tvrtko.ursulin@linux.intel.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, julia.lawall@inria.fr, ebiederm@xmission.com, linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, ocfs2-devel@oss.oracle.com Subject: Re: [Ocfs2-devel] [PATCH v2 6/8] inotify: simplify subdirectory registration with register_sysctl() X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jan Kara via Ocfs2-devel Reply-to: Jan Kara Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-ServerName: smtp-out1.suse.de X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 ip4:137.65.0.0/16 ip4:151.155.28.0/17 ip4:149.44.0.0/16 ip4:147.2.0.0/16 ip4:164.99.0.0/16 ip4:130.57.0.0/16 ip4:192.31.114.0/24 ip4:195.135.221.0/24 ip4:195.135.220.0/24 ip4:69.7.179.0/24 ip4:150.215.214.0/24 include:mailcontrol.com ~all X-Spam: Clean X-Proofpoint-GUID: 11G63GYGjijuQh8PwRz706KmLzPznAZB X-Proofpoint-ORIG-GUID: 11G63GYGjijuQh8PwRz706KmLzPznAZB Reporting-Meta: AAHR9XZxIzIhXyvWNcsjtiiAbLB15qhI3xa23BMWryO29qJPwq0E4DTWdiZs4dou QOHM/CiF9bLENokQakGDK65YzAeAVHYdonpkI7/M9Vr26q6xxllnUBr3Gu4nZquW vV4IyqGdP7yp+vYcZOaiugWskVkOPHqNvvjZj+WzmmHYNeBNOy+rBovi90ALdEcA f6v3cPKo/SkG0/AufozgnG8GHcVi7JQ53ZnR4eTWuDUmTObgkAJ+sKZ0WSd/YiB4 +itcxvUx4nUaDeweJL7bV2J4pXv8Cl+QVWCKM14MZ7nWS11zJk8DFrooV4pumsal B8DNAQpL6P3GgBeFDNt76ffWho0o0ExW9SGLly+9ELPoTWu7Cm4McZN7G6bjGc8U bJiO+hBi8ZHRtsCt3CwCFpWKWbF7xENrF1HWTjJxoiwY9OIf+JunOuM3giyqdTis lU/DWf4gDyPUKgCZATTwAnjkK0IA1M9aSFoY4yd8u9LpTitUJ8D0pUbxKqA+bzid gVLXeTbSDd/BsO0li5sVIlPhVMDY1vX1hHvJ1iLc06Y= On Tue 23-11-21 12:24:20, Luis Chamberlain wrote: > From: Xiaoming Ni > > There is no need to user boiler plate code to specify a set of base > directories we're going to stuff sysctls under. Simplify this by using > register_sysctl() and specifying the directory path directly. > > Move inotify_user sysctl to inotify_user.c while at it to remove clutter > from kernel/sysctl.c. > > Signed-off-by: Xiaoming Ni > [mcgrof: update commit log to reflect new path we decided to take] > Signed-off-by: Luis Chamberlain This looks fishy. You register inotify_table but not fanotify_table and remove both... Honza > --- > fs/notify/inotify/inotify_user.c | 11 ++++++++++- > include/linux/inotify.h | 3 --- > kernel/sysctl.c | 21 --------------------- > 3 files changed, 10 insertions(+), 25 deletions(-) > > diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c > index 29fca3284bb5..54583f62dc44 100644 > --- a/fs/notify/inotify/inotify_user.c > +++ b/fs/notify/inotify/inotify_user.c > @@ -58,7 +58,7 @@ struct kmem_cache *inotify_inode_mark_cachep __read_mostly; > static long it_zero = 0; > static long it_int_max = INT_MAX; > > -struct ctl_table inotify_table[] = { > +static struct ctl_table inotify_table[] = { > { > .procname = "max_user_instances", > .data = &init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES], > @@ -87,6 +87,14 @@ struct ctl_table inotify_table[] = { > }, > { } > }; > + > +static void __init inotify_sysctls_init(void) > +{ > + register_sysctl("fs/inotify", inotify_table); > +} > + > +#else > +#define inotify_sysctls_init() do { } while (0) > #endif /* CONFIG_SYSCTL */ > > static inline __u32 inotify_arg_to_mask(struct inode *inode, u32 arg) > @@ -849,6 +857,7 @@ static int __init inotify_user_setup(void) > inotify_max_queued_events = 16384; > init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES] = 128; > init_user_ns.ucount_max[UCOUNT_INOTIFY_WATCHES] = watches_max; > + inotify_sysctls_init(); > > return 0; > } > diff --git a/include/linux/inotify.h b/include/linux/inotify.h > index 6a24905f6e1e..8d20caa1b268 100644 > --- a/include/linux/inotify.h > +++ b/include/linux/inotify.h > @@ -7,11 +7,8 @@ > #ifndef _LINUX_INOTIFY_H > #define _LINUX_INOTIFY_H > > -#include > #include > > -extern struct ctl_table inotify_table[]; /* for sysctl */ > - > #define ALL_INOTIFY_BITS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ > IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \ > IN_MOVED_TO | IN_CREATE | IN_DELETE | \ > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index 7a90a12b9ea4..6aa67c737e4e 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -125,13 +125,6 @@ static const int maxolduid = 65535; > static const int ngroups_max = NGROUPS_MAX; > static const int cap_last_cap = CAP_LAST_CAP; > > -#ifdef CONFIG_INOTIFY_USER > -#include > -#endif > -#ifdef CONFIG_FANOTIFY > -#include > -#endif > - > #ifdef CONFIG_PROC_SYSCTL > > /** > @@ -3099,20 +3092,6 @@ static struct ctl_table fs_table[] = { > .proc_handler = proc_dointvec, > }, > #endif > -#ifdef CONFIG_INOTIFY_USER > - { > - .procname = "inotify", > - .mode = 0555, > - .child = inotify_table, > - }, > -#endif > -#ifdef CONFIG_FANOTIFY > - { > - .procname = "fanotify", > - .mode = 0555, > - .child = fanotify_table, > - }, > -#endif > #ifdef CONFIG_EPOLL > { > .procname = "epoll", > -- > 2.33.0 > -- Jan Kara SUSE Labs, CR _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B07CCC433EF for ; Wed, 24 Nov 2021 09:46:31 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HzbkG1YxGz3dhF for ; Wed, 24 Nov 2021 20:46:30 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=Fa3DfqPo; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=jBk0LyCf; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=suse.cz (client-ip=195.135.220.28; helo=smtp-out1.suse.de; envelope-from=jack@suse.cz; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=Fa3DfqPo; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=jBk0LyCf; dkim-atps=neutral Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Hzbgf014Vz3cYp for ; Wed, 24 Nov 2021 20:44:13 +1100 (AEDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 57BF02193C; Wed, 24 Nov 2021 09:44:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1637747050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xjctS9e3aLk//fWwNzII/UY4G5OnovggWZdyEKD1t34=; b=Fa3DfqPoxkPRyFtLFipUAPsRoQ7583RIvIkjGcirn+ZDIVuZJxTkgHZCWQWJkaYcgx/XTF 6Tg+qvMREmzgGwP+y0PqF0I8yljZj0emBD/1N75E2fyVfhSwuHdlW27Cq87y3T4+dKDpTg m3CDIAdfVxCay7j/D++92R/TIMACYbw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1637747050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xjctS9e3aLk//fWwNzII/UY4G5OnovggWZdyEKD1t34=; b=jBk0LyCfiE1g4jR+z/f8PsVbXLRirmoGyBWY3eutEhQ8eC54ZtfGnQdZjQkRNSqRSaajn0 YL6WjUHTxaO0ZHAA== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id A4AA0A3B8E; Wed, 24 Nov 2021 09:44:09 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 844E41E14AC; Wed, 24 Nov 2021 10:44:09 +0100 (CET) Date: Wed, 24 Nov 2021 10:44:09 +0100 From: Jan Kara To: Luis Chamberlain Subject: Re: [PATCH v2 6/8] inotify: simplify subdirectory registration with register_sysctl() Message-ID: <20211124094409.GF8583@quack2.suse.cz> References: <20211123202422.819032-1-mcgrof@kernel.org> <20211123202422.819032-7-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211123202422.819032-7-mcgrof@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jack@suse.cz, airlied@linux.ie, amir73il@gmail.com, clemens@ladisch.de, dri-devel@lists.freedesktop.org, phil@philpotter.co.uk, joseph.qi@linux.alibaba.com, mark@fasheh.com, yzaikin@google.com, joonas.lahtinen@linux.intel.com, keescook@chromium.org, arnd@arndb.de, intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com, viro@zeniv.linux.org.uk, rodrigo.vivi@intel.com, nixiaoming@huawei.com, tvrtko.ursulin@linux.intel.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, julia.lawall@inria.fr, ebiederm@xmission.com, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, ocfs2-devel@oss.oracle.com, jlbec@evilplan.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue 23-11-21 12:24:20, Luis Chamberlain wrote: > From: Xiaoming Ni > > There is no need to user boiler plate code to specify a set of base > directories we're going to stuff sysctls under. Simplify this by using > register_sysctl() and specifying the directory path directly. > > Move inotify_user sysctl to inotify_user.c while at it to remove clutter > from kernel/sysctl.c. > > Signed-off-by: Xiaoming Ni > [mcgrof: update commit log to reflect new path we decided to take] > Signed-off-by: Luis Chamberlain This looks fishy. You register inotify_table but not fanotify_table and remove both... Honza > --- > fs/notify/inotify/inotify_user.c | 11 ++++++++++- > include/linux/inotify.h | 3 --- > kernel/sysctl.c | 21 --------------------- > 3 files changed, 10 insertions(+), 25 deletions(-) > > diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c > index 29fca3284bb5..54583f62dc44 100644 > --- a/fs/notify/inotify/inotify_user.c > +++ b/fs/notify/inotify/inotify_user.c > @@ -58,7 +58,7 @@ struct kmem_cache *inotify_inode_mark_cachep __read_mostly; > static long it_zero = 0; > static long it_int_max = INT_MAX; > > -struct ctl_table inotify_table[] = { > +static struct ctl_table inotify_table[] = { > { > .procname = "max_user_instances", > .data = &init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES], > @@ -87,6 +87,14 @@ struct ctl_table inotify_table[] = { > }, > { } > }; > + > +static void __init inotify_sysctls_init(void) > +{ > + register_sysctl("fs/inotify", inotify_table); > +} > + > +#else > +#define inotify_sysctls_init() do { } while (0) > #endif /* CONFIG_SYSCTL */ > > static inline __u32 inotify_arg_to_mask(struct inode *inode, u32 arg) > @@ -849,6 +857,7 @@ static int __init inotify_user_setup(void) > inotify_max_queued_events = 16384; > init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES] = 128; > init_user_ns.ucount_max[UCOUNT_INOTIFY_WATCHES] = watches_max; > + inotify_sysctls_init(); > > return 0; > } > diff --git a/include/linux/inotify.h b/include/linux/inotify.h > index 6a24905f6e1e..8d20caa1b268 100644 > --- a/include/linux/inotify.h > +++ b/include/linux/inotify.h > @@ -7,11 +7,8 @@ > #ifndef _LINUX_INOTIFY_H > #define _LINUX_INOTIFY_H > > -#include > #include > > -extern struct ctl_table inotify_table[]; /* for sysctl */ > - > #define ALL_INOTIFY_BITS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ > IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \ > IN_MOVED_TO | IN_CREATE | IN_DELETE | \ > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index 7a90a12b9ea4..6aa67c737e4e 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -125,13 +125,6 @@ static const int maxolduid = 65535; > static const int ngroups_max = NGROUPS_MAX; > static const int cap_last_cap = CAP_LAST_CAP; > > -#ifdef CONFIG_INOTIFY_USER > -#include > -#endif > -#ifdef CONFIG_FANOTIFY > -#include > -#endif > - > #ifdef CONFIG_PROC_SYSCTL > > /** > @@ -3099,20 +3092,6 @@ static struct ctl_table fs_table[] = { > .proc_handler = proc_dointvec, > }, > #endif > -#ifdef CONFIG_INOTIFY_USER > - { > - .procname = "inotify", > - .mode = 0555, > - .child = inotify_table, > - }, > -#endif > -#ifdef CONFIG_FANOTIFY > - { > - .procname = "fanotify", > - .mode = 0555, > - .child = fanotify_table, > - }, > -#endif > #ifdef CONFIG_EPOLL > { > .procname = "epoll", > -- > 2.33.0 > -- Jan Kara SUSE Labs, CR From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B75B5C433FE for ; Wed, 24 Nov 2021 09:44:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B3126E2D5; Wed, 24 Nov 2021 09:44:13 +0000 (UTC) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 262AB6E222; Wed, 24 Nov 2021 09:44:12 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 57BF02193C; Wed, 24 Nov 2021 09:44:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1637747050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xjctS9e3aLk//fWwNzII/UY4G5OnovggWZdyEKD1t34=; b=Fa3DfqPoxkPRyFtLFipUAPsRoQ7583RIvIkjGcirn+ZDIVuZJxTkgHZCWQWJkaYcgx/XTF 6Tg+qvMREmzgGwP+y0PqF0I8yljZj0emBD/1N75E2fyVfhSwuHdlW27Cq87y3T4+dKDpTg m3CDIAdfVxCay7j/D++92R/TIMACYbw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1637747050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xjctS9e3aLk//fWwNzII/UY4G5OnovggWZdyEKD1t34=; b=jBk0LyCfiE1g4jR+z/f8PsVbXLRirmoGyBWY3eutEhQ8eC54ZtfGnQdZjQkRNSqRSaajn0 YL6WjUHTxaO0ZHAA== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id A4AA0A3B8E; Wed, 24 Nov 2021 09:44:09 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 844E41E14AC; Wed, 24 Nov 2021 10:44:09 +0100 (CET) Date: Wed, 24 Nov 2021 10:44:09 +0100 From: Jan Kara To: Luis Chamberlain Subject: Re: [PATCH v2 6/8] inotify: simplify subdirectory registration with register_sysctl() Message-ID: <20211124094409.GF8583@quack2.suse.cz> References: <20211123202422.819032-1-mcgrof@kernel.org> <20211123202422.819032-7-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211123202422.819032-7-mcgrof@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jack@suse.cz, airlied@linux.ie, amir73il@gmail.com, clemens@ladisch.de, dri-devel@lists.freedesktop.org, phil@philpotter.co.uk, joseph.qi@linux.alibaba.com, mark@fasheh.com, yzaikin@google.com, keescook@chromium.org, arnd@arndb.de, intel-gfx@lists.freedesktop.org, viro@zeniv.linux.org.uk, rodrigo.vivi@intel.com, nixiaoming@huawei.com, tvrtko.ursulin@linux.intel.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, julia.lawall@inria.fr, ebiederm@xmission.com, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, ocfs2-devel@oss.oracle.com, jlbec@evilplan.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue 23-11-21 12:24:20, Luis Chamberlain wrote: > From: Xiaoming Ni > > There is no need to user boiler plate code to specify a set of base > directories we're going to stuff sysctls under. Simplify this by using > register_sysctl() and specifying the directory path directly. > > Move inotify_user sysctl to inotify_user.c while at it to remove clutter > from kernel/sysctl.c. > > Signed-off-by: Xiaoming Ni > [mcgrof: update commit log to reflect new path we decided to take] > Signed-off-by: Luis Chamberlain This looks fishy. You register inotify_table but not fanotify_table and remove both... Honza > --- > fs/notify/inotify/inotify_user.c | 11 ++++++++++- > include/linux/inotify.h | 3 --- > kernel/sysctl.c | 21 --------------------- > 3 files changed, 10 insertions(+), 25 deletions(-) > > diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c > index 29fca3284bb5..54583f62dc44 100644 > --- a/fs/notify/inotify/inotify_user.c > +++ b/fs/notify/inotify/inotify_user.c > @@ -58,7 +58,7 @@ struct kmem_cache *inotify_inode_mark_cachep __read_mostly; > static long it_zero = 0; > static long it_int_max = INT_MAX; > > -struct ctl_table inotify_table[] = { > +static struct ctl_table inotify_table[] = { > { > .procname = "max_user_instances", > .data = &init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES], > @@ -87,6 +87,14 @@ struct ctl_table inotify_table[] = { > }, > { } > }; > + > +static void __init inotify_sysctls_init(void) > +{ > + register_sysctl("fs/inotify", inotify_table); > +} > + > +#else > +#define inotify_sysctls_init() do { } while (0) > #endif /* CONFIG_SYSCTL */ > > static inline __u32 inotify_arg_to_mask(struct inode *inode, u32 arg) > @@ -849,6 +857,7 @@ static int __init inotify_user_setup(void) > inotify_max_queued_events = 16384; > init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES] = 128; > init_user_ns.ucount_max[UCOUNT_INOTIFY_WATCHES] = watches_max; > + inotify_sysctls_init(); > > return 0; > } > diff --git a/include/linux/inotify.h b/include/linux/inotify.h > index 6a24905f6e1e..8d20caa1b268 100644 > --- a/include/linux/inotify.h > +++ b/include/linux/inotify.h > @@ -7,11 +7,8 @@ > #ifndef _LINUX_INOTIFY_H > #define _LINUX_INOTIFY_H > > -#include > #include > > -extern struct ctl_table inotify_table[]; /* for sysctl */ > - > #define ALL_INOTIFY_BITS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ > IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \ > IN_MOVED_TO | IN_CREATE | IN_DELETE | \ > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index 7a90a12b9ea4..6aa67c737e4e 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -125,13 +125,6 @@ static const int maxolduid = 65535; > static const int ngroups_max = NGROUPS_MAX; > static const int cap_last_cap = CAP_LAST_CAP; > > -#ifdef CONFIG_INOTIFY_USER > -#include > -#endif > -#ifdef CONFIG_FANOTIFY > -#include > -#endif > - > #ifdef CONFIG_PROC_SYSCTL > > /** > @@ -3099,20 +3092,6 @@ static struct ctl_table fs_table[] = { > .proc_handler = proc_dointvec, > }, > #endif > -#ifdef CONFIG_INOTIFY_USER > - { > - .procname = "inotify", > - .mode = 0555, > - .child = inotify_table, > - }, > -#endif > -#ifdef CONFIG_FANOTIFY > - { > - .procname = "fanotify", > - .mode = 0555, > - .child = fanotify_table, > - }, > -#endif > #ifdef CONFIG_EPOLL > { > .procname = "epoll", > -- > 2.33.0 > -- Jan Kara SUSE Labs, CR From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0B81C433F5 for ; Wed, 24 Nov 2021 09:44:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237774AbhKXJrV (ORCPT ); Wed, 24 Nov 2021 04:47:21 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:60648 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230151AbhKXJrV (ORCPT ); Wed, 24 Nov 2021 04:47:21 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 57BF02193C; Wed, 24 Nov 2021 09:44:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1637747050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xjctS9e3aLk//fWwNzII/UY4G5OnovggWZdyEKD1t34=; b=Fa3DfqPoxkPRyFtLFipUAPsRoQ7583RIvIkjGcirn+ZDIVuZJxTkgHZCWQWJkaYcgx/XTF 6Tg+qvMREmzgGwP+y0PqF0I8yljZj0emBD/1N75E2fyVfhSwuHdlW27Cq87y3T4+dKDpTg m3CDIAdfVxCay7j/D++92R/TIMACYbw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1637747050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xjctS9e3aLk//fWwNzII/UY4G5OnovggWZdyEKD1t34=; b=jBk0LyCfiE1g4jR+z/f8PsVbXLRirmoGyBWY3eutEhQ8eC54ZtfGnQdZjQkRNSqRSaajn0 YL6WjUHTxaO0ZHAA== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id A4AA0A3B8E; Wed, 24 Nov 2021 09:44:09 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 844E41E14AC; Wed, 24 Nov 2021 10:44:09 +0100 (CET) Date: Wed, 24 Nov 2021 10:44:09 +0100 From: Jan Kara To: Luis Chamberlain Cc: akpm@linux-foundation.org, keescook@chromium.org, yzaikin@google.com, nixiaoming@huawei.com, ebiederm@xmission.com, clemens@ladisch.de, arnd@arndb.de, gregkh@linuxfoundation.org, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com, airlied@linux.ie, benh@kernel.crashing.org, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, jack@suse.cz, amir73il@gmail.com, phil@philpotter.co.uk, viro@zeniv.linux.org.uk, julia.lawall@inria.fr, ocfs2-devel@oss.oracle.com, linuxppc-dev@lists.ozlabs.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 6/8] inotify: simplify subdirectory registration with register_sysctl() Message-ID: <20211124094409.GF8583@quack2.suse.cz> References: <20211123202422.819032-1-mcgrof@kernel.org> <20211123202422.819032-7-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211123202422.819032-7-mcgrof@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue 23-11-21 12:24:20, Luis Chamberlain wrote: > From: Xiaoming Ni > > There is no need to user boiler plate code to specify a set of base > directories we're going to stuff sysctls under. Simplify this by using > register_sysctl() and specifying the directory path directly. > > Move inotify_user sysctl to inotify_user.c while at it to remove clutter > from kernel/sysctl.c. > > Signed-off-by: Xiaoming Ni > [mcgrof: update commit log to reflect new path we decided to take] > Signed-off-by: Luis Chamberlain This looks fishy. You register inotify_table but not fanotify_table and remove both... Honza > --- > fs/notify/inotify/inotify_user.c | 11 ++++++++++- > include/linux/inotify.h | 3 --- > kernel/sysctl.c | 21 --------------------- > 3 files changed, 10 insertions(+), 25 deletions(-) > > diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c > index 29fca3284bb5..54583f62dc44 100644 > --- a/fs/notify/inotify/inotify_user.c > +++ b/fs/notify/inotify/inotify_user.c > @@ -58,7 +58,7 @@ struct kmem_cache *inotify_inode_mark_cachep __read_mostly; > static long it_zero = 0; > static long it_int_max = INT_MAX; > > -struct ctl_table inotify_table[] = { > +static struct ctl_table inotify_table[] = { > { > .procname = "max_user_instances", > .data = &init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES], > @@ -87,6 +87,14 @@ struct ctl_table inotify_table[] = { > }, > { } > }; > + > +static void __init inotify_sysctls_init(void) > +{ > + register_sysctl("fs/inotify", inotify_table); > +} > + > +#else > +#define inotify_sysctls_init() do { } while (0) > #endif /* CONFIG_SYSCTL */ > > static inline __u32 inotify_arg_to_mask(struct inode *inode, u32 arg) > @@ -849,6 +857,7 @@ static int __init inotify_user_setup(void) > inotify_max_queued_events = 16384; > init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES] = 128; > init_user_ns.ucount_max[UCOUNT_INOTIFY_WATCHES] = watches_max; > + inotify_sysctls_init(); > > return 0; > } > diff --git a/include/linux/inotify.h b/include/linux/inotify.h > index 6a24905f6e1e..8d20caa1b268 100644 > --- a/include/linux/inotify.h > +++ b/include/linux/inotify.h > @@ -7,11 +7,8 @@ > #ifndef _LINUX_INOTIFY_H > #define _LINUX_INOTIFY_H > > -#include > #include > > -extern struct ctl_table inotify_table[]; /* for sysctl */ > - > #define ALL_INOTIFY_BITS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ > IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \ > IN_MOVED_TO | IN_CREATE | IN_DELETE | \ > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index 7a90a12b9ea4..6aa67c737e4e 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -125,13 +125,6 @@ static const int maxolduid = 65535; > static const int ngroups_max = NGROUPS_MAX; > static const int cap_last_cap = CAP_LAST_CAP; > > -#ifdef CONFIG_INOTIFY_USER > -#include > -#endif > -#ifdef CONFIG_FANOTIFY > -#include > -#endif > - > #ifdef CONFIG_PROC_SYSCTL > > /** > @@ -3099,20 +3092,6 @@ static struct ctl_table fs_table[] = { > .proc_handler = proc_dointvec, > }, > #endif > -#ifdef CONFIG_INOTIFY_USER > - { > - .procname = "inotify", > - .mode = 0555, > - .child = inotify_table, > - }, > -#endif > -#ifdef CONFIG_FANOTIFY > - { > - .procname = "fanotify", > - .mode = 0555, > - .child = fanotify_table, > - }, > -#endif > #ifdef CONFIG_EPOLL > { > .procname = "epoll", > -- > 2.33.0 > -- Jan Kara SUSE Labs, CR