Commit 2374c09b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Al Viro

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.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 26363af5
...@@ -22,4 +22,8 @@ extern void do_coredump(const kernel_siginfo_t *siginfo); ...@@ -22,4 +22,8 @@ extern void do_coredump(const kernel_siginfo_t *siginfo);
static inline void do_coredump(const kernel_siginfo_t *siginfo) {} static inline void do_coredump(const kernel_siginfo_t *siginfo) {}
#endif #endif
extern int core_uses_pid;
extern char core_pattern[];
extern unsigned int core_pipe_limit;
#endif /* _LINUX_COREDUMP_H */ #endif /* _LINUX_COREDUMP_H */
...@@ -94,4 +94,6 @@ extern void fd_install(unsigned int fd, struct file *file); ...@@ -94,4 +94,6 @@ extern void fd_install(unsigned int fd, struct file *file);
extern void flush_delayed_fput(void); extern void flush_delayed_fput(void);
extern void __fput_sync(struct file *); extern void __fput_sync(struct file *);
extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max;
#endif /* __LINUX_FILE_H */ #endif /* __LINUX_FILE_H */
...@@ -3140,5 +3140,7 @@ unsigned long wp_shared_mapping_range(struct address_space *mapping, ...@@ -3140,5 +3140,7 @@ unsigned long wp_shared_mapping_range(struct address_space *mapping,
pgoff_t first_index, pgoff_t nr); pgoff_t first_index, pgoff_t nr);
#endif #endif
extern int sysctl_nr_trim_pages;
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _LINUX_MM_H */ #endif /* _LINUX_MM_H */
...@@ -909,6 +909,7 @@ static inline int is_highmem(struct zone *zone) ...@@ -909,6 +909,7 @@ static inline int is_highmem(struct zone *zone)
/* These two functions are used to setup the per zone pages min values */ /* These two functions are used to setup the per zone pages min values */
struct ctl_table; struct ctl_table;
int min_free_kbytes_sysctl_handler(struct ctl_table *, int, int min_free_kbytes_sysctl_handler(struct ctl_table *, int,
void __user *, size_t *, loff_t *); void __user *, size_t *, loff_t *);
int watermark_scale_factor_sysctl_handler(struct ctl_table *, int, int watermark_scale_factor_sysctl_handler(struct ctl_table *, int,
...@@ -925,6 +926,7 @@ int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, ...@@ -925,6 +926,7 @@ int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int,
extern int numa_zonelist_order_handler(struct ctl_table *, int, extern int numa_zonelist_order_handler(struct ctl_table *, int,
void __user *, size_t *, loff_t *); void __user *, size_t *, loff_t *);
extern int percpu_pagelist_fraction;
extern char numa_zonelist_order[]; extern char numa_zonelist_order[];
#define NUMA_ZONELIST_ORDER_LEN 16 #define NUMA_ZONELIST_ORDER_LEN 16
......
...@@ -108,6 +108,9 @@ extern void transfer_pid(struct task_struct *old, struct task_struct *new, ...@@ -108,6 +108,9 @@ extern void transfer_pid(struct task_struct *old, struct task_struct *new,
struct pid_namespace; struct pid_namespace;
extern struct pid_namespace init_pid_ns; extern struct pid_namespace init_pid_ns;
extern int pid_max;
extern int pid_max_min, pid_max_max;
/* /*
* look up a PID in the hash table. Must be called with the tasklist_lock * look up a PID in the hash table. Must be called with the tasklist_lock
* or rcu_read_lock() held. * or rcu_read_lock() held.
......
...@@ -207,7 +207,15 @@ void unregister_sysctl_table(struct ctl_table_header * table); ...@@ -207,7 +207,15 @@ void unregister_sysctl_table(struct ctl_table_header * table);
extern int sysctl_init(void); extern int sysctl_init(void);
extern int pwrsw_enabled;
extern int unaligned_enabled;
extern int unaligned_dump_stack;
extern int no_unaligned_warning;
extern struct ctl_table sysctl_mount_point[]; extern struct ctl_table sysctl_mount_point[];
extern struct ctl_table random_table[];
extern struct ctl_table firmware_config_table[];
extern struct ctl_table epoll_table[];
#else /* CONFIG_SYSCTL */ #else /* CONFIG_SYSCTL */
static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table) static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table)
......
...@@ -68,6 +68,9 @@ ...@@ -68,6 +68,9 @@
#include <linux/bpf.h> #include <linux/bpf.h>
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/userfaultfd_k.h> #include <linux/userfaultfd_k.h>
#include <linux/coredump.h>
#include <linux/latencytop.h>
#include <linux/pid.h>
#include "../lib/kstrtox.h" #include "../lib/kstrtox.h"
...@@ -103,22 +106,6 @@ ...@@ -103,22 +106,6 @@
#if defined(CONFIG_SYSCTL) #if defined(CONFIG_SYSCTL)
/* External variables not in a header file. */
extern int suid_dumpable;
#ifdef CONFIG_COREDUMP
extern int core_uses_pid;
extern char core_pattern[];
extern unsigned int core_pipe_limit;
#endif
extern int pid_max;
extern int pid_max_min, pid_max_max;
extern int percpu_pagelist_fraction;
extern int latencytop_enabled;
extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max;
#ifndef CONFIG_MMU
extern int sysctl_nr_trim_pages;
#endif
/* Constants used for minimum and maximum */ /* Constants used for minimum and maximum */
#ifdef CONFIG_LOCKUP_DETECTOR #ifdef CONFIG_LOCKUP_DETECTOR
static int sixty = 60; static int sixty = 60;
...@@ -160,24 +147,6 @@ static unsigned long hung_task_timeout_max = (LONG_MAX/HZ); ...@@ -160,24 +147,6 @@ static unsigned long hung_task_timeout_max = (LONG_MAX/HZ);
#ifdef CONFIG_INOTIFY_USER #ifdef CONFIG_INOTIFY_USER
#include <linux/inotify.h> #include <linux/inotify.h>
#endif #endif
#ifdef CONFIG_SPARC
#endif
#ifdef CONFIG_PARISC
extern int pwrsw_enabled;
#endif
#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
extern int unaligned_enabled;
#endif
#ifdef CONFIG_IA64
extern int unaligned_dump_stack;
#endif
#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
extern int no_unaligned_warning;
#endif
#ifdef CONFIG_PROC_SYSCTL #ifdef CONFIG_PROC_SYSCTL
...@@ -243,14 +212,6 @@ static struct ctl_table vm_table[]; ...@@ -243,14 +212,6 @@ static struct ctl_table vm_table[];
static struct ctl_table fs_table[]; static struct ctl_table fs_table[];
static struct ctl_table debug_table[]; static struct ctl_table debug_table[];
static struct ctl_table dev_table[]; static struct ctl_table dev_table[];
extern struct ctl_table random_table[];
#ifdef CONFIG_EPOLL
extern struct ctl_table epoll_table[];
#endif
#ifdef CONFIG_FW_LOADER_USER_HELPER
extern struct ctl_table firmware_config_table[];
#endif
#if defined(HAVE_ARCH_PICK_MMAP_LAYOUT) || \ #if defined(HAVE_ARCH_PICK_MMAP_LAYOUT) || \
defined(CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT) defined(CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment