mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
kernel: pid_namespace: simplify sysctls with register_sysctl()
register_sysctl_paths() is only required if your child (directories) have entries and pid_namespace does not. So use register_sysctl_init() instead where we don't care about the return value and use register_sysctl() where we do. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Acked-by: Jeff Xu <jeffxu@google.com> Link: https://lore.kernel.org/r/20230302202826.776286-9-mcgrof@kernel.org
This commit is contained in:
@@ -46,10 +46,9 @@ static struct ctl_table pid_ns_ctl_table_vm[] = {
|
||||
},
|
||||
{ }
|
||||
};
|
||||
static struct ctl_path vm_path[] = { { .procname = "vm", }, { } };
|
||||
static inline void register_pid_ns_sysctl_table_vm(void)
|
||||
{
|
||||
register_sysctl_paths(vm_path, pid_ns_ctl_table_vm);
|
||||
register_sysctl("vm", pid_ns_ctl_table_vm);
|
||||
}
|
||||
#else
|
||||
static inline void initialize_memfd_noexec_scope(struct pid_namespace *ns) {}
|
||||
|
||||
Reference in New Issue
Block a user