History

sysctl: remove all extern declaration from sysctl.c

Extern declarations in .c files are a bad style and can lead to mismatches. Use existing definitions in headers where they exist, and otherwise move the external declarations to suitable header files.

Christoph Hellwig committed 6 years ago

Commit 2374c091 parent 26363af7 files · +24 −42Browse files

Showing the changes to include/linux (6 of 7 files). Show all

Unified · Split

6 files
  1. include/linux/coredump.h +4 −0
  2. include/linux/file.h +2 −0
  3. include/linux/mm.h +2 −0
  4. include/linux/mmzone.h +2 −0
  5. include/linux/pid.h +3 −0
  6. include/linux/sysctl.h +8 −0
include/linux/coredump.h+4−0
@@ -22,4 +22,8 @@ extern void do_coredump(const kernel_siginfo_t *siginfo); · 21 unmodified lines
22static inline void do_coredump(const kernel_siginfo_t *siginfo) {}22static inline void do_coredump(const kernel_siginfo_t *siginfo) {}
23#endif23#endif
24 24
25extern int core_uses_pid;
26extern char core_pattern[];
27extern unsigned int core_pipe_limit;
28
25#endif /* _LINUX_COREDUMP_H */29#endif /* _LINUX_COREDUMP_H */
include/linux/file.h+2−0
@@ -94,4 +94,6 @@ extern void fd_install(unsigned int fd, struct file *file); · 93 unmodified lines
94extern void flush_delayed_fput(void);94extern void flush_delayed_fput(void);
95extern void __fput_sync(struct file *);95extern void __fput_sync(struct file *);
96 96
97extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max;
98
97#endif /* __LINUX_FILE_H */99#endif /* __LINUX_FILE_H */
include/linux/mm.h+2−0
@@ -3140,5 +3140,7 @@ unsigned long wp_shared_mapping_range(struct address_space *mapping, · 3139 unmodified lines
3140 pgoff_t first_index, pgoff_t nr);3140 pgoff_t first_index, pgoff_t nr);
3141#endif3141#endif
3142 3142
3143extern int sysctl_nr_trim_pages;
3144
3143#endif /* __KERNEL__ */3145#endif /* __KERNEL__ */
3144#endif /* _LINUX_MM_H */3146#endif /* _LINUX_MM_H */
include/linux/mmzone.h+2−0
@@ -909,6 +909,7 @@ static inline int is_highmem(struct zone *zone) · 908 unmodified lines
909 909
910/* These two functions are used to setup the per zone pages min values */910/* These two functions are used to setup the per zone pages min values */
911struct ctl_table;911struct ctl_table;
912
912int min_free_kbytes_sysctl_handler(struct ctl_table *, int,913int min_free_kbytes_sysctl_handler(struct ctl_table *, int,
913 void __user *, size_t *, loff_t *);914 void __user *, size_t *, loff_t *);
914int watermark_scale_factor_sysctl_handler(struct ctl_table *, int,915int watermark_scale_factor_sysctl_handler(struct ctl_table *, int,
@@ -925,6 +926,7 @@ int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, · 10 unmodified lines
925 926
926extern int numa_zonelist_order_handler(struct ctl_table *, int,927extern int numa_zonelist_order_handler(struct ctl_table *, int,
927 void __user *, size_t *, loff_t *);928 void __user *, size_t *, loff_t *);
929extern int percpu_pagelist_fraction;
928extern char numa_zonelist_order[];930extern char numa_zonelist_order[];
929#define NUMA_ZONELIST_ORDER_LEN 16931#define NUMA_ZONELIST_ORDER_LEN 16
930 932
include/linux/pid.h+3−0
@@ -108,6 +108,9 @@ extern void transfer_pid(struct task_struct *old, struct task_struct *new, · 107 unmodified lines
108struct pid_namespace;108struct pid_namespace;
109extern struct pid_namespace init_pid_ns;109extern struct pid_namespace init_pid_ns;
110 110
111extern int pid_max;
112extern int pid_max_min, pid_max_max;
113
111/*114/*
112 * look up a PID in the hash table. Must be called with the tasklist_lock115 * look up a PID in the hash table. Must be called with the tasklist_lock
113 * or rcu_read_lock() held.116 * or rcu_read_lock() held.
include/linux/sysctl.h+8−0
@@ -207,7 +207,15 @@ void unregister_sysctl_table(struct ctl_table_header * table); · 206 unmodified lines
207 207
208extern int sysctl_init(void);208extern int sysctl_init(void);
209 209
210extern int pwrsw_enabled;
211extern int unaligned_enabled;
212extern int unaligned_dump_stack;
213extern int no_unaligned_warning;
214
210extern struct ctl_table sysctl_mount_point[];215extern struct ctl_table sysctl_mount_point[];
216extern struct ctl_table random_table[];
217extern struct ctl_table firmware_config_table[];
218extern struct ctl_table epoll_table[];
211 219
212#else /* CONFIG_SYSCTL */220#else /* CONFIG_SYSCTL */
213static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table)221static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table)