Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Joel Granados <joel.granados@kernel.org>

+19 -11
-3
include/linux/sysctl.h
··· 284 284 } 285 285 #endif /* CONFIG_SYSCTL */ 286 286 287 - int sysctl_max_threads(const struct ctl_table *table, int write, void *buffer, 288 - size_t *lenp, loff_t *ppos); 289 - 290 287 #endif /* _LINUX_SYSCTL_H */
+19 -1
kernel/fork.c
··· 3216 3216 return 0; 3217 3217 } 3218 3218 3219 - int sysctl_max_threads(const struct ctl_table *table, int write, 3219 + static int sysctl_max_threads(const struct ctl_table *table, int write, 3220 3220 void *buffer, size_t *lenp, loff_t *ppos) 3221 3221 { 3222 3222 struct ctl_table t; ··· 3238 3238 3239 3239 return 0; 3240 3240 } 3241 + 3242 + static const struct ctl_table fork_sysctl_table[] = { 3243 + { 3244 + .procname = "threads-max", 3245 + .data = NULL, 3246 + .maxlen = sizeof(int), 3247 + .mode = 0644, 3248 + .proc_handler = sysctl_max_threads, 3249 + }, 3250 + }; 3251 + 3252 + static int __init init_fork_sysctl(void) 3253 + { 3254 + register_sysctl_init("kernel", fork_sysctl_table); 3255 + return 0; 3256 + } 3257 + 3258 + subsys_initcall(init_fork_sysctl);
-7
kernel/sysctl.c
··· 1631 1631 }, 1632 1632 #endif 1633 1633 { 1634 - .procname = "threads-max", 1635 - .data = NULL, 1636 - .maxlen = sizeof(int), 1637 - .mode = 0644, 1638 - .proc_handler = sysctl_max_threads, 1639 - }, 1640 - { 1641 1634 .procname = "overflowuid", 1642 1635 .data = &overflowuid, 1643 1636 .maxlen = sizeof(int),