Commit 8e5f04b0 authored by Joel Granados's avatar Joel Granados
Browse files

fork: mv threads-max into kernel/fork.c



make sysctl_max_threads static as it no longer needs to be exported into
sysctl.c.

This is part of a greater effort to move ctl tables into their
respective subsystems which will reduce the merge conflicts in
kernel/sysctl.c.

Reviewed-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
Reviewed-by: default avatarKees Cook <kees@kernel.org>
Signed-off-by: default avatarJoel Granados <joel.granados@kernel.org>
parent 9e2f403d
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -284,7 +284,4 @@ static inline bool sysctl_is_alias(char *param)
}
#endif /* CONFIG_SYSCTL */

int sysctl_max_threads(const struct ctl_table *table, int write, void *buffer,
		size_t *lenp, loff_t *ppos);

#endif /* _LINUX_SYSCTL_H */
+19 −1
Original line number Diff line number Diff line
@@ -3216,7 +3216,7 @@ int unshare_files(void)
	return 0;
}

int sysctl_max_threads(const struct ctl_table *table, int write,
static int sysctl_max_threads(const struct ctl_table *table, int write,
		       void *buffer, size_t *lenp, loff_t *ppos)
{
	struct ctl_table t;
@@ -3238,3 +3238,21 @@ int sysctl_max_threads(const struct ctl_table *table, int write,

	return 0;
}

static const struct ctl_table fork_sysctl_table[] = {
	{
		.procname	= "threads-max",
		.data		= NULL,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= sysctl_max_threads,
	},
};

static int __init init_fork_sysctl(void)
{
	register_sysctl_init("kernel", fork_sysctl_table);
	return 0;
}

subsys_initcall(init_fork_sysctl);
+0 −7
Original line number Diff line number Diff line
@@ -1630,13 +1630,6 @@ static const struct ctl_table kern_table[] = {
		.proc_handler	= proc_do_cad_pid,
	},
#endif
	{
		.procname	= "threads-max",
		.data		= NULL,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= sysctl_max_threads,
	},
	{
		.procname	= "overflowuid",
		.data		= &overflowuid,