fs: Remove the now superfluous sentinel elements from ctl_table array
authorJoel Granados <j.granados@samsung.com>
Tue, 21 Nov 2023 11:35:12 +0000 (12:35 +0100)
committerLuis Chamberlain <mcgrof@kernel.org>
Thu, 28 Dec 2023 12:57:57 +0000 (04:57 -0800)
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which
will reduce the overall build time size of the kernel and run time
memory bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)

Remove sentinel elements ctl_table struct. Special attention was placed in
making sure that an empty directory for fs/verity was created when
CONFIG_FS_VERITY_BUILTIN_SIGNATURES is not defined. In this case we use the
register sysctl call that expects a size.

Signed-off-by: Joel Granados <j.granados@samsung.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Acked-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
26 files changed:
fs/aio.c
fs/coredump.c
fs/dcache.c
fs/devpts/inode.c
fs/eventpoll.c
fs/exec.c
fs/file_table.c
fs/inode.c
fs/lockd/svc.c
fs/locks.c
fs/namei.c
fs/namespace.c
fs/nfs/nfs4sysctl.c
fs/nfs/sysctl.c
fs/notify/dnotify/dnotify.c
fs/notify/fanotify/fanotify_user.c
fs/notify/inotify/inotify_user.c
fs/ntfs/sysctl.c
fs/ocfs2/stackglue.c
fs/pipe.c
fs/proc/proc_sysctl.c
fs/quota/dquot.c
fs/sysctls.c
fs/userfaultfd.c
fs/verity/init.c
fs/xfs/xfs_sysctl.c

index f8589caef9c10ec829bc6470cab5ce159915114c..ec8fdac7f9b64c4c3bb634962ed1033044c4911c 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -239,7 +239,6 @@ static struct ctl_table aio_sysctls[] = {
                .mode           = 0644,
                .proc_handler   = proc_doulongvec_minmax,
        },
-       {}
 };
 
 static void __init aio_sysctl_init(void)
index 9d235fa14ab98f28fd8c334920647e682fa52767..f258c17c18411284b9725ed88110de32fadc8993 100644 (file)
@@ -981,7 +981,6 @@ static struct ctl_table coredump_sysctls[] = {
                .mode           = 0644,
                .proc_handler   = proc_dointvec,
        },
-       { }
 };
 
 static int __init init_fs_coredump_sysctls(void)
index c82ae731df9af780e58db42b45ba198375be2819..0bcfdc66823e28770b956d3f364abd5bcb1b3abb 100644 (file)
@@ -191,7 +191,6 @@ static struct ctl_table fs_dcache_sysctls[] = {
                .mode           = 0444,
                .proc_handler   = proc_nr_dentry,
        },
-       { }
 };
 
 static int __init init_fs_dcache_sysctls(void)
index c830261aa8831c555a193661cbdadf90fe9c9946..b20e565b9c5ea3cd83c8a8d2be1629551f558286 100644 (file)
@@ -69,7 +69,6 @@ static struct ctl_table pty_table[] = {
                .data           = &pty_count,
                .proc_handler   = proc_dointvec,
        },
-       {}
 };
 
 struct pts_mount_opts {
index 2877cc01cff180f1910913eefb4b9fa6c041de1f..3534d36a147400079bfd618d198e47fe669aee5f 100644 (file)
@@ -322,7 +322,6 @@ static struct ctl_table epoll_table[] = {
                .extra1         = &long_zero,
                .extra2         = &long_max,
        },
-       { }
 };
 
 static void __init epoll_sysctls_init(void)
index 4aa19b24f2810a428a91c30ab96f931b5f505954..dc7e5d66b3fa99782fdd065c2b28a665a3da08a9 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -2165,7 +2165,6 @@ static struct ctl_table fs_exec_sysctls[] = {
                .extra1         = SYSCTL_ZERO,
                .extra2         = SYSCTL_TWO,
        },
-       { }
 };
 
 static int __init init_fs_exec_sysctls(void)
index de4a2915bfd4941281915be92ce7dbdd8f67ac3b..d3af9feb4ad59743df43d9f8f24c82e6e15de7c9 100644 (file)
@@ -142,7 +142,6 @@ static struct ctl_table fs_stat_sysctls[] = {
                .extra1         = &sysctl_nr_open_min,
                .extra2         = &sysctl_nr_open_max,
        },
-       { }
 };
 
 static int __init init_fs_stat_sysctls(void)
index f238d987dec901150ac759d51a7996dc208bd1f8..0a9dd0c3e03fec55e86986a6e92ea085214d0cc6 100644 (file)
@@ -129,7 +129,6 @@ static struct ctl_table inodes_sysctls[] = {
                .mode           = 0444,
                .proc_handler   = proc_nr_inodes,
        },
-       { }
 };
 
 static int __init init_fs_inode_sysctls(void)
index 81be07c1d3d156abe7f7ff1d5802601d7c5dfa38..96dc040656aefa3e05795493021cc62d9729acc5 100644 (file)
@@ -475,7 +475,6 @@ static struct ctl_table nlm_sysctls[] = {
                .mode           = 0644,
                .proc_handler   = proc_dointvec,
        },
-       { }
 };
 
 #endif /* CONFIG_SYSCTL */
index 46d88b9e222cf2c50897e120248f7231821f579f..cc7c117ee19294410b02333638ba5f810b0cdadd 100644 (file)
@@ -111,7 +111,6 @@ static struct ctl_table locks_sysctls[] = {
                .proc_handler   = proc_dointvec,
        },
 #endif /* CONFIG_MMU */
-       {}
 };
 
 static int __init init_fs_locks_sysctls(void)
index 71c13b2990b44f426a778bb0ad8f969a89387b4f..03660a29664fd47d7096a578cfbc6e4d38493322 100644 (file)
@@ -1071,7 +1071,6 @@ static struct ctl_table namei_sysctls[] = {
                .extra1         = SYSCTL_ZERO,
                .extra2         = SYSCTL_TWO,
        },
-       { }
 };
 
 static int __init init_fs_namei_sysctls(void)
index fbf0e596fcd30c9bae8d8cc1fbe09cf309f02334..91ca4693f905f39c1a138a493c3ab2e4876dd8f8 100644 (file)
@@ -5010,7 +5010,6 @@ static struct ctl_table fs_namespace_sysctls[] = {
                .proc_handler   = proc_dointvec_minmax,
                .extra1         = SYSCTL_ONE,
        },
-       { }
 };
 
 static int __init init_fs_namespace_sysctls(void)
index e776200e9a115e7af40d989c79a1ec845007b9e9..886a7c4c60b35a49a64a3ec67aa7fccec4a49bc0 100644 (file)
@@ -34,7 +34,6 @@ static struct ctl_table nfs4_cb_sysctls[] = {
                .mode = 0644,
                .proc_handler = proc_dointvec,
        },
-       { }
 };
 
 int nfs4_register_sysctl(void)
index f39e2089bc4c2a0330da15f8227787afd1744dea..e645be1a338177c0626954bf64ea659b5750b691 100644 (file)
@@ -29,7 +29,6 @@ static struct ctl_table nfs_cb_sysctls[] = {
                .mode           = 0644,
                .proc_handler   = proc_dointvec,
        },
-       { }
 };
 
 int nfs_register_sysctl(void)
index 1cb9ad7e884e1516320b7dd7f01ba686757db159..3464fa7e85380f94b0331371c69a221743ae5e9c 100644 (file)
@@ -29,7 +29,6 @@ static struct ctl_table dnotify_sysctls[] = {
                .mode           = 0644,
                .proc_handler   = proc_dointvec,
        },
-       {}
 };
 static void __init dnotify_sysctl_init(void)
 {
index 4d765c72496f0a59bbf06dd44e455ce84433907d..f902c0f58537bab056e2dbc4a318bcd14b86052d 100644 (file)
@@ -86,7 +86,6 @@ static struct ctl_table fanotify_table[] = {
                .proc_handler   = proc_dointvec_minmax,
                .extra1         = SYSCTL_ZERO
        },
-       { }
 };
 
 static void __init fanotify_sysctls_init(void)
index a3809ae9217027845dfd5a607e16947ac01a70b3..85d8fdd55329438d52deeed3fb53ead13798bceb 100644 (file)
@@ -85,7 +85,6 @@ static struct ctl_table inotify_table[] = {
                .proc_handler   = proc_dointvec_minmax,
                .extra1         = SYSCTL_ZERO
        },
-       { }
 };
 
 static void __init inotify_sysctls_init(void)
index 174fe536a1c05d2da4b417bca062839fb3041f09..4e980170d86a40ebbc4f1d96d95f6c4c1b7ba599 100644 (file)
@@ -28,7 +28,6 @@ static struct ctl_table ntfs_sysctls[] = {
                .mode           = 0644,                 /* Mode, proc handler. */
                .proc_handler   = proc_dointvec
        },
-       {}
 };
 
 /* Storage for the sysctls header. */
index a8d5ca98fa57c4f602dd2769e43ebe33c39bd219..20aa37b67cfb1581c6a73e24d5c3577b83499643 100644 (file)
@@ -658,7 +658,6 @@ static struct ctl_table ocfs2_nm_table[] = {
                .mode           = 0644,
                .proc_handler   = proc_dostring,
        },
-       { }
 };
 
 static struct ctl_table_header *ocfs2_table_header;
index 804a7d78945217efd3b5394a8a8e6e7d605a937a..4ed752910c6c7aa9152dbd1d444967e0438aabe9 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1497,7 +1497,6 @@ static struct ctl_table fs_pipe_sysctls[] = {
                .mode           = 0644,
                .proc_handler   = proc_doulongvec_minmax,
        },
-       { }
 };
 #endif
 
index 84abf98340a0494c963bc35e4150373431a016f2..7e16ce3ccbae2d4be54cb2eb11aaa67cce367421 100644 (file)
@@ -71,7 +71,6 @@ static struct ctl_table root_table[] = {
                .procname = "",
                .mode = S_IFDIR|S_IRUGO|S_IXUGO,
        },
-       { }
 };
 static struct ctl_table_root sysctl_table_root = {
        .default_set.dir.header = {
index 58b5de081b5714e89f212f893caa59527f025f5d..6ad4140bca9ca53d8443cad5d9d4d9181fd76150 100644 (file)
@@ -2969,7 +2969,6 @@ static struct ctl_table fs_dqstats_table[] = {
                .proc_handler   = proc_dointvec,
        },
 #endif
-       { },
 };
 
 static int __init dquot_init(void)
index 76a0aee8c2291b18a8b98b2a3eda81b7d376cddb..8dbde9a802fa42b55542e7c7038c66ae18382472 100644 (file)
@@ -26,7 +26,6 @@ static struct ctl_table fs_shared_sysctls[] = {
                .extra1         = SYSCTL_ZERO,
                .extra2         = SYSCTL_MAXOLDUID,
        },
-       { }
 };
 
 static int __init init_fs_sysctls(void)
index e8af40b0554956e16e9bdd0af00c33c04c424ec6..1d642d1d28c659abc57ebeae786f0b790a857c69 100644 (file)
@@ -45,7 +45,6 @@ static struct ctl_table vm_userfaultfd_table[] = {
                .extra1         = SYSCTL_ZERO,
                .extra2         = SYSCTL_ONE,
        },
-       { }
 };
 #endif
 
index a29f062f6047b82712f88365328eb8e04f84a7c3..b64a76b9ac362b2207ecf780050fcec3a8f3c5cc 100644 (file)
@@ -24,7 +24,6 @@ static struct ctl_table fsverity_sysctl_table[] = {
                .extra2         = SYSCTL_ONE,
        },
 #endif
-       { }
 };
 
 static void __init fsverity_init_sysctl(void)
index fade337353931663ec17ff72a47d74b9053c901c..a191f6560f98594be6c7cef58fb586872ef2ff63 100644 (file)
@@ -206,8 +206,6 @@ static struct ctl_table xfs_table[] = {
                .extra2         = &xfs_params.stats_clear.max
        },
 #endif /* CONFIG_PROC_FS */
-
-       {}
 };
 
 int