Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1233935pxb; Fri, 18 Feb 2022 03:37:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlkBIjMbybK41LDurKIiqC2Rqng5taDYSqZdCt3CYbU93j1GykhRF1xj6J+2hzTv14BKRA X-Received: by 2002:a05:6a00:c95:b0:4e1:3259:f7ad with SMTP id a21-20020a056a000c9500b004e13259f7admr7287295pfv.43.1645184251209; Fri, 18 Feb 2022 03:37:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645184251; cv=none; d=google.com; s=arc-20160816; b=zWpiIP0y4Ms/tL25cgavAkORvjgmQ/rZBW450vOMFr0Qp6YKKh8ZXLo+mzzJkBQJmo 4gTuio+p6sb4z7p71m7ZYOqqK2Tnifja+ECOI9A34nT+4O5F+SKqV13Q5q9eeDJE69aD g3ZmhbhhWH/kRWlq8Shyp4syKydq24qzIWwfU3bvAoJq3VT7j8aVEgX1c7pPeTst4vLe ZihviY9LtcL+229/y3UzPIUXgUFKcCiy/Gkoz+OBKA1Sm9A+NUb8+mdDbTg2KXAEFquW aac3Jr1gMfzqphJTJPr/ce5+q1Ps03r/Ll8ghj8nWXYbdzbje0uXVdZxEhcnm5gINzF7 hqvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=N5nr203HdMUm+0Wpp9JLT0GsTsUxVNJL7mr3UptoeRE=; b=ZeLaZ0IIsSLw9lT1z6RP8ZQZy95Ewuxy86lw/W1Cu850ULjQNFfuA80ZDogF184bKp WagZiOX0RLCTTGoeBrWvOt9sOByNeA44Qw1mL2UjsfdUobI9YoOZINnlT2Ttw8onTVPI o/vqNr8iKV/RExfPy5Lnmgj+cdCfBKCr0WcBRdPV3T1sJwqXEfGVy0FC25e8+lvudTQM bbMhGtfw1LzcV9UkjurZ4Q4D68lLpMR+PvYAcLTCj5rk88dt6wt6ZyvkTxEWcz+5qEBo u8v8qe6/R6mcbKEQ3XXu4rivdDG65O29ceoYUBZGbQuRz2slE/yKa3Fn6PoHm9DsF65x 7LrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bg25si11449048pgb.820.2022.02.18.03.37.17; Fri, 18 Feb 2022 03:37:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234218AbiBRLAO (ORCPT + 99 others); Fri, 18 Feb 2022 06:00:14 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234228AbiBRLAK (ORCPT ); Fri, 18 Feb 2022 06:00:10 -0500 Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A70AD25AE46 for ; Fri, 18 Feb 2022 02:59:52 -0800 (PST) X-QQ-mid: bizesmtp89t1645181973tkblj3mn Received: from localhost.localdomain (unknown [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 18 Feb 2022 18:59:26 +0800 (CST) X-QQ-SSF: 01400000002000B0E000B00M0000000 X-QQ-FEAT: xoS364mEyr0CAqAcI82K48d2BBOqblN61/BW+RmdSzYjTe4TvLWIT7OcdmMuO 0YxSJBr3XScxDsuRA9Yd7Dp9Zu5GULGLgnohfTrw8kLMQskT57GsGQwiQ+eih0eIgNoISQ0 q9RaLJlAGGhS9WQu4+K5T5rDPH73xGwwkW7nyj9mASerrUkCnVPoplQ43uJprwyGsubfqwS B7yYdvtL7FLvj6RqKSe02B40Nu/E7rq1Ammw38uRuOb3/cqwNU6glLc5RGCpcP7YCqkttTq emv4kzCqVTJtkLpe4UlKbezUjcdrO2hnjxvvoTngsz3eoAeW4duCJNqO8O7ExRQn5s5bDIX u9bRR4E8bBIjuX+BCGN69Y+ayMPwxKh1FTG4ljBpSq149oRCeuZfpLjvEflDg== X-QQ-GoodBg: 2 From: tangmeng To: mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, tangmeng Subject: [PATCH 3/5] kernel/acct: move acct sysctls to its own file Date: Fri, 18 Feb 2022 18:59:23 +0800 Message-Id: <20220218105923.12829-1-tangmeng@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign6 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. All filesystem syctls now get reviewed by fs folks. This commit follows the commit of fs, move the acct sysctl to its own file, kernel/acct.c. Signed-off-by: tangmeng --- include/linux/acct.h | 1 - kernel/acct.c | 22 +++++++++++++++++++++- kernel/sysctl.c | 12 ------------ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/include/linux/acct.h b/include/linux/acct.h index bc70e81895c0..2718c4854815 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h @@ -21,7 +21,6 @@ #ifdef CONFIG_BSD_PROCESS_ACCT struct pid_namespace; -extern int acct_parm[]; /* for sysctl */ extern void acct_collect(long exitcode, int group_dead); extern void acct_process(void); extern void acct_exit_ns(struct pid_namespace *); diff --git a/kernel/acct.c b/kernel/acct.c index 3df53cf1dcd5..13706356ec54 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -70,11 +70,31 @@ * Turned into sysctl-controllable parameters. AV, 12/11/98 */ -int acct_parm[3] = {4, 2, 30}; +static int acct_parm[3] = {4, 2, 30}; #define RESUME (acct_parm[0]) /* >foo% free space - resume */ #define SUSPEND (acct_parm[1]) /* #endif -#ifdef CONFIG_BSD_PROCESS_ACCT -#include -#endif #ifdef CONFIG_RT_MUTEXES #include #endif @@ -1862,15 +1859,6 @@ static struct ctl_table kern_table[] = { .proc_handler = proc_dostring, }, #endif -#ifdef CONFIG_BSD_PROCESS_ACCT - { - .procname = "acct", - .data = &acct_parm, - .maxlen = 3*sizeof(int), - .mode = 0644, - .proc_handler = proc_dointvec, - }, -#endif #ifdef CONFIG_MAGIC_SYSRQ { .procname = "sysrq", -- 2.20.1