Skip to content

Commit b13bc7c

Browse files
Liu Shixinmcgrof
authored andcommitted
kernel/sysctl.c: move sysctl_vals and sysctl_long_vals to sysctl.c
sysctl_vals and sysctl_long_vals are declared even if sysctl is disabled. Move its definition to sysctl.c to make sure their integrity in any case. Signed-off-by: Liu Shixin <liushixin2@huawei.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
1 parent feb2bd0 commit b13bc7c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

fs/proc/proc_sysctl.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ static const struct inode_operations proc_sys_inode_operations;
2828
static const struct file_operations proc_sys_dir_file_operations;
2929
static const struct inode_operations proc_sys_dir_operations;
3030

31-
/* shared constants to be used in various sysctls */
32-
const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 };
33-
EXPORT_SYMBOL(sysctl_vals);
34-
35-
const unsigned long sysctl_long_vals[] = { 0, 1, LONG_MAX };
36-
EXPORT_SYMBOL_GPL(sysctl_long_vals);
37-
3831
/* Support for permanently empty directories */
3932

4033
struct ctl_table sysctl_mount_point[] = {

kernel/sysctl.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,16 @@
8282
#include <linux/rtmutex.h>
8383
#endif
8484

85+
/* shared constants to be used in various sysctls */
86+
const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 };
87+
EXPORT_SYMBOL(sysctl_vals);
88+
89+
const unsigned long sysctl_long_vals[] = { 0, 1, LONG_MAX };
90+
EXPORT_SYMBOL_GPL(sysctl_long_vals);
91+
8592
#if defined(CONFIG_SYSCTL)
8693

87-
/* Constants used for minimum and maximum */
94+
/* Constants used for minimum and maximum */
8895

8996
#ifdef CONFIG_PERF_EVENTS
9097
static const int six_hundred_forty_kb = 640 * 1024;

0 commit comments

Comments
 (0)