diff options
author | Joel Granados <joel.granados@gmail.com> | 2023-08-09 13:50:00 +0300 |
---|---|---|
committer | Luis Chamberlain <mcgrof@kernel.org> | 2023-08-16 01:26:17 +0300 |
commit | 95d4977876d6658fdee58be8c8668aac68c25dd2 (patch) | |
tree | 6d100d3ef40dcce07dbe56cb76de6832f44cc983 /net/ax25/sysctl_net_ax25.c | |
parent | 3bc269cfd3e119be84b69d95aec3a9e147016bb2 (diff) | |
download | linux-95d4977876d6658fdee58be8c8668aac68c25dd2.tar.xz |
sysctl: Add size to register_net_sysctl function
This commit adds size to the register_net_sysctl indirection function to
facilitate the removal of the sentinel elements (last empty markers)
from the ctl_table arrays. Though we don't actually remove any sentinels
in this commit, register_net_sysctl* now has the capability of
forwarding table_size for when that happens.
We create a new function register_net_sysctl_sz with an extra size
argument. A macro replaces the existing register_net_sysctl. The size in
the macro is SIZE_MAX instead of ARRAY_SIZE to avoid compilation errors
while we systematically migrate to register_net_sysctl_sz. Will change
to ARRAY_SIZE in subsequent commits.
Care is taken to add table_size to the stopping criteria in such a way
that when we remove the empty sentinel element, it will continue
stopping in the last element of the ctl_table array.
Signed-off-by: Joel Granados <j.granados@samsung.com>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'net/ax25/sysctl_net_ax25.c')
0 files changed, 0 insertions, 0 deletions