All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Granados <j.granados@samsung.com>
To: <mcgrof@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Joel Granados <j.granados@samsung.com>,
	<linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Iurii Zaikin <yzaikin@google.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH v4 0/8] sysctl: Completely remove register_sysctl_table from sources
Date: Tue, 23 May 2023 14:22:12 +0200	[thread overview]
Message-ID: <20230523122220.1610825-1-j.granados@samsung.com> (raw)
In-Reply-To: CGME20230523122224eucas1p1834662efdd6d8e6f03db5c52b6e0a7ea@eucas1p1.samsung.com

This is part of the general push to deprecate register_sysctl_paths and
register_sysctl_table. It contains 2 patchsets that were originally sent
separately. I have put them together because the second followed the first.

Parport driver uses the "CHILD" pointer in the ctl_table structure to create
its directory structure. We move to the newer register_sysctl call and remove
the pointer madness. I have separated the parport into 5 patches to clarify the
different changes needed for the 3 calls to register_sysctl_paths.

We no longer export the register_sysctl_table call as parport was the
last user from outside proc_sysctl.c. Also modified documentation slightly
so register_sysctl_table is no longer mentioned.

Replace register_sysctl_table with register_sysctl effectively effectively
transitioning 5 base paths ("kernel", "vm", "fs", "dev" and "debug") to the new
call. Besides removing the actual function, I also removed it from the checks
done in check-sysctl-docs. @mcgrof went a bit further and removed 2 more
functions.

Testing for this change was done in the same way as with previous sysctl
replacement patches: I made sure that the result of `find /proc/sys/ | sha1sum`
was the same before and after the patchset.

V4:
* (mcgrof) : use of register_sysctl_init instead of register_sysctl
* (mcgrof) : removed register_sysctl_table and __register_sysctl_base
* Added a unregister call to properly unwind things when there is an error
* Added kernel proc subdirectories "kernel/usermodehelper" and "kernel/keys"

V3:
* Added a return error value when register fails
* Made sure to free the memory on error when calling parport_proc_register
* Added a bloat-o-meter output to measure bloat
* Replaced kmalloc with kzalloc
* Added comments about testing
* Improved readability when using snprintf

Have pushed this through 0-day. Waiting on results..

Best
Joel

Joel Granados (8):
  parport: Move magic number "15" to a define
  parport: Remove register_sysctl_table from parport_proc_register
  parport: Remove register_sysctl_table from
    parport_device_proc_register
  parport: Remove register_sysctl_table from
    parport_default_proc_register
  parport: Removed sysctl related defines
  sysctl: stop exporting register_sysctl_table
  sysctl: Refactor base paths registrations
  sysctl: Remove register_sysctl_table

 drivers/parport/procfs.c  | 174 ++++++++++++++++++++------------------
 drivers/parport/share.c   |   2 +-
 fs/proc/proc_sysctl.c     | 162 +----------------------------------
 fs/sysctls.c              |   5 +-
 include/linux/parport.h   |   2 +
 include/linux/sysctl.h    |  31 +------
 kernel/sysctl.c           |  30 ++-----
 scripts/check-sysctl-docs |  10 ---
 8 files changed, 110 insertions(+), 306 deletions(-)

-- 
2.30.2


       reply	other threads:[~2023-05-23 12:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230523122224eucas1p1834662efdd6d8e6f03db5c52b6e0a7ea@eucas1p1.samsung.com>
2023-05-23 12:22 ` Joel Granados [this message]
     [not found]   ` <CGME20230523122226eucas1p2bc0a2c060f01f460a11e90545f9da9aa@eucas1p2.samsung.com>
2023-05-23 12:22     ` [PATCH v4 1/8] parport: Move magic number "15" to a define Joel Granados
     [not found]   ` <CGME20230523122227eucas1p2ee83e872a9a3babd1196a286a34e175a@eucas1p2.samsung.com>
2023-05-23 12:22     ` [PATCH v4 2/8] parport: Remove register_sysctl_table from parport_proc_register Joel Granados
     [not found]   ` <CGME20230523122229eucas1p2ea47c3d872cc7dd6f52de85e2e304b8c@eucas1p2.samsung.com>
2023-05-23 12:22     ` [PATCH v4 3/8] parport: Remove register_sysctl_table from parport_device_proc_register Joel Granados
     [not found]   ` <CGME20230523122231eucas1p25c90d2764372faba72095f5c43715ffb@eucas1p2.samsung.com>
2023-05-23 12:22     ` [PATCH v4 4/8] parport: Remove register_sysctl_table from parport_default_proc_register Joel Granados
     [not found]   ` <CGME20230523122233eucas1p1cb488b94dc2449b3bd0314b1f536a6e9@eucas1p1.samsung.com>
2023-05-23 12:22     ` [PATCH v4 5/8] parport: Removed sysctl related defines Joel Granados
     [not found]   ` <CGME20230523122235eucas1p1398322259883bb53846e3445d7fd1cc6@eucas1p1.samsung.com>
2023-05-23 12:22     ` [PATCH v4 6/8] sysctl: stop exporting register_sysctl_table Joel Granados
     [not found]   ` <CGME20230523122236eucas1p17639bfdbfb30c9d751e0a8fc85fe2fd3@eucas1p1.samsung.com>
2023-05-23 12:22     ` [PATCH v4 7/8] sysctl: Refactor base paths registrations Joel Granados
2023-05-23 12:56       ` Christian Brauner
2023-05-25  8:37       ` Dan Carpenter
2023-05-26 10:22         ` Joel Granados
     [not found]   ` <CGME20230523122239eucas1p19c23501df7732d16422ab0489503c764@eucas1p1.samsung.com>
2023-05-23 12:22     ` [PATCH v4 8/8] sysctl: Remove register_sysctl_table Joel Granados
2023-05-23 12:57       ` Christian Brauner
2023-05-24  4:44   ` [PATCH v4 0/8] sysctl: Completely remove register_sysctl_table from sources Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230523122220.1610825-1-j.granados@samsung.com \
    --to=j.granados@samsung.com \
    --cc=brauner@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yzaikin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.