diff options
author | Luis Chamberlain <mcgrof@kernel.org> | 2023-05-18 13:40:15 -0700 |
---|---|---|
committer | Luis Chamberlain <mcgrof@kernel.org> | 2023-05-30 15:46:11 -0700 |
commit | 996ef312f27fa8ee8715c6ec77b6a3cdb748bdca (patch) | |
tree | 3bb19c2b7ca7ff5e287e2763da564eb75aa6f11e /kernel/sysctl.c | |
parent | b8cbc0855a22fe386c704ee29fb21282f999b995 (diff) |
sysctl: remove empty dev table
Now that all the dev sysctls have been moved out we can remove the
dev sysctl base directory. We don't need to create base directories,
they are created for you as if using 'mkdir -p' with register_syctl()
and register_sysctl_init(). For details refer to sysctl_mkdir_p()
usage.
We save 90 bytes with this changes:
./scripts/bloat-o-meter vmlinux.2.remove-sysctl-table vmlinux.3-remove-dev-table
add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-90 (-90)
Function old new delta
sysctl_init_bases 111 85 -26
dev_table 64 - -64
Total: Before=21257057, After=21256967, chg -0.00%
The empty dev table has been in place since the v2.5.0 days because
back then ordering was essentialy. But later commit 7ec66d06362d
("sysctl: Stop requiring explicit management of sysctl directories"),
merged as of v3.4-rc1, the entire ordering of directories was replaced
by allowing sysctl directory autogeneration. This new mechanism
introduced on v3.4 allows for sysctl directories to automatically be
created for sysctl tables when they are needed and automatically removes
them when no sysctl tables use them. That commit also added a dedicated
struct ctl_dir as a new type for these autogenerated directories.
Reviewed-by: Joel Granados <j.granados@samsung.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 73fa9cf7ee11..9552f221f568 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2332,10 +2332,6 @@ static struct ctl_table debug_table[] = { { } }; -static struct ctl_table dev_table[] = { - { } -}; - int __init sysctl_init_bases(void) { register_sysctl_init("kernel", kern_table); @@ -2346,7 +2342,6 @@ int __init sysctl_init_bases(void) register_sysctl_init("vm", vm_table); register_sysctl_init("debug", debug_table); - register_sysctl_init("dev", dev_table); return 0; } |