Skip to contentSkip to conversation

sysctl extern cleanup - binfmts

PATCH In review Dave Young 2 participants 4 messages Feb 21, 2010

Subsystems (2)
lore
Share & tools
lore

Dave Young

author
#0 lore raw

PATCH 3/17 sysctl extern cleanup - binfmts

Extern declarations in sysctl.c should be move to their own head file, and then include them in relavant .c files.

Move core_uses_pid/core_pattern/core_pipe_limit extern declarations to linux/binfmts.h
suid_dumpable is declared in binfmts.h already.

---
 include/linux/binfmts.h |    5 +++++
 kernel/sysctl.c         |    5 +----
 2 files changed, 6 insertions(+), 4 deletions(-)
kernel/sysctl.c +1 -4
@@ -55,6 +55,7 @@
 #include <linux/perf_event.h>
 #include <linux/rcustring.h>
 #include <linux/signal.h>
+#include <linux/binfmts.h>
 
 #include <asm/uaccess.h>
 #include <asm/processor.h>
@@ -70,10 +71,6 @@
 
 /* External variables not in a header file. */
 extern int max_threads;
-extern int core_uses_pid;
-extern int suid_dumpable;
-extern char *core_pattern;
-extern unsigned int core_pipe_limit;
 extern int pid_max;
 extern int min_free_kbytes;
 extern int pid_max_min, pid_max_max;
include/linux/binfmts.h +5 -0
@@ -20,6 +20,11 @@ struct pt_regs;
 #ifdef __KERNEL__
 #include <linux/list.h>
 
+/* for sysctl */
+extern int core_uses_pid;
+extern char *core_pattern;
+extern unsigned int core_pipe_limit;
+
 #define CORENAME_MAX_SIZE 128
 
 /*
#1 lore raw

include/linux/binfmts.h struct pt_regs; · line 23

Quoted 7 lines · Dave Young
include/linux/binfmts.h +1 -0
@@ -20,6 +20,11 @@ struct pt_regs;
 #ifdef __KERNEL__
 #include <linux/list.h>
 
+/* for sysctl */

This comment is neither accurate nor needed. :^)

In fact master sysctl table always was a big mess, so slight mess caused by extern declarations is fine.

Quoted 3 lines
include/linux/binfmts.h +3 -0
+extern int core_uses_pid;
+extern char *core_pattern;
+extern unsigned int core_pipe_limit;
#3 lore raw
In reply to Dave Young
Quoted 15 lines · Dave Young
Quoted 10 lines · Alexey Dobriyan

include/linux/binfmts.h struct pt_regs; · line 23

Quoted 7 lines · Dave Young
include/linux/binfmts.h +1 -0
@@ -20,6 +20,11 @@ struct pt_regs;
  #ifdef __KERNEL__
  #include <linux/list.h>
 
+/* for sysctl */

This comment is neither accurate nor needed. :^)

Thanks, sounds good, but the there's no other file use the three vars.

Quoted 1 line
Quoted 6 lines
Quoted 6 lines

In fact master sysctl table always was a big mess, so slight mess caused by extern declarations is fine.

include/linux/binfmts.h struct pt_regs; · line 26

Quoted 3 lines
include/linux/binfmts.h +3 -0
+extern int core_uses_pid;
+extern char *core_pattern;
+extern unsigned int core_pipe_limit;

In fact coredump code should be moved out of fs/exec.c including headers, so this movement is quite pointless.

author
#2 lore raw
In reply to Alexey Dobriyan
Quoted 10 lines · Alexey Dobriyan

include/linux/binfmts.h struct pt_regs; · line 23

Quoted 7 lines · Dave Young
include/linux/binfmts.h +1 -0
@@ -20,6 +20,11 @@ struct pt_regs;
  #ifdef __KERNEL__
  #include <linux/list.h>
 
+/* for sysctl */

This comment is neither accurate nor needed. :^)

Thanks, sounds good, but the there's no other file use the three vars.

Quoted 8 lines

In fact master sysctl table always was a big mess, so slight mess caused by extern declarations is fine.

Quoted 3 lines
include/linux/binfmts.h +3 -0
+extern int core_uses_pid;
+extern char *core_pattern;
+extern unsigned int core_pipe_limit;
Signature · 2 lines
Regards
dave