Commit 6f79387d authored by Art Haas's avatar Art Haas Committed by James Bottomley

[PATCH] C99 struct initializers for kernel files

parent 6be13f9a
...@@ -32,11 +32,12 @@ static u_long ident_map[32] = { ...@@ -32,11 +32,12 @@ static u_long ident_map[32] = {
}; };
struct exec_domain default_exec_domain = { struct exec_domain default_exec_domain = {
"Linux", /* name */ .name = "Linux", /* name */
default_handler, /* lcall7 causes a seg fault. */ .handler = default_handler, /* lcall7 causes a seg fault. */
0, 0, /* PER_LINUX personality. */ .pers_low = 0, /* PER_LINUX personality. */
ident_map, /* Identity map signals. */ .pers_high = 0, /* PER_LINUX personality. */
ident_map, /* - both ways. */ .signal_map = ident_map, /* Identity map signals. */
.signal_invmap = ident_map, /* - both ways. */
}; };
...@@ -247,24 +248,65 @@ u_int abi_traceflg; ...@@ -247,24 +248,65 @@ u_int abi_traceflg;
int abi_fake_utsname; int abi_fake_utsname;
static struct ctl_table abi_table[] = { static struct ctl_table abi_table[] = {
{ABI_DEFHANDLER_COFF, "defhandler_coff", &abi_defhandler_coff, {
sizeof(int), 0644, NULL, &proc_doulongvec_minmax}, .ctl_name = ABI_DEFHANDLER_COFF,
{ABI_DEFHANDLER_ELF, "defhandler_elf", &abi_defhandler_elf, .procname = "defhandler_coff",
sizeof(int), 0644, NULL, &proc_doulongvec_minmax}, .data = &abi_defhandler_coff,
{ABI_DEFHANDLER_LCALL7, "defhandler_lcall7", &abi_defhandler_lcall7, .maxlen = sizeof(int),
sizeof(int), 0644, NULL, &proc_doulongvec_minmax}, .mode = 0644,
{ABI_DEFHANDLER_LIBCSO, "defhandler_libcso", &abi_defhandler_libcso, .proc_handler = &proc_doulongvec_minmax,
sizeof(int), 0644, NULL, &proc_doulongvec_minmax}, },
{ABI_TRACE, "trace", &abi_traceflg, {
sizeof(u_int), 0644, NULL, &proc_dointvec}, .ctl_name = ABI_DEFHANDLER_ELF,
{ABI_FAKE_UTSNAME, "fake_utsname", &abi_fake_utsname, .procname = "defhandler_elf",
sizeof(int), 0644, NULL, &proc_dointvec}, .data = &abi_defhandler_elf,
{0} .maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_doulongvec_minmax,
},
{
.ctl_name = ABI_DEFHANDLER_LCALL7,
.procname = "defhandler_lcall7",
.data = &abi_defhandler_lcall7,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_doulongvec_minmax,
},
{
.ctl_name = ABI_DEFHANDLER_LIBCSO,
.procname = "defhandler_libcso",
.data = &abi_defhandler_libcso,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_doulongvec_minmax,
},
{
.ctl_name = ABI_TRACE,
.procname = "trace",
.data = &abi_traceflg,
.maxlen = sizeof(u_int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = ABI_FAKE_UTSNAME,
.procname = "fake_utsname",
.data = &abi_fake_utsname,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{ .ctl_name = 0 }
}; };
static struct ctl_table abi_root_table[] = { static struct ctl_table abi_root_table[] = {
{CTL_ABI, "abi", NULL, 0, 0555, abi_table}, {
{0} .ctl_name = CTL_ABI,
.procname = "abi",
.mode = 0555,
.child = abi_table,
},
{ .ctl_name = 0 }
}; };
static int __init static int __init
......
...@@ -20,8 +20,19 @@ ...@@ -20,8 +20,19 @@
#include <asm/io.h> #include <asm/io.h>
struct resource ioport_resource = { "PCI IO", 0x0000, IO_SPACE_LIMIT, IORESOURCE_IO }; struct resource ioport_resource = {
struct resource iomem_resource = { "PCI mem", 0UL, ~0UL, IORESOURCE_MEM }; .name = "PCI IO",
.start = 0x0000,
.end = IO_SPACE_LIMIT,
.flags = IORESOURCE_IO,
};
struct resource iomem_resource = {
.name = "PCI mem",
.start = 0UL,
.end = ~0UL,
.flags = IORESOURCE_MEM,
};
static rwlock_t resource_lock = RW_LOCK_UNLOCKED; static rwlock_t resource_lock = RW_LOCK_UNLOCKED;
......
...@@ -149,123 +149,408 @@ static void unregister_proc_table(ctl_table *, struct proc_dir_entry *); ...@@ -149,123 +149,408 @@ static void unregister_proc_table(ctl_table *, struct proc_dir_entry *);
/* The default sysctl tables: */ /* The default sysctl tables: */
static ctl_table root_table[] = { static ctl_table root_table[] = {
{CTL_KERN, "kernel", NULL, 0, 0555, kern_table}, {
{CTL_VM, "vm", NULL, 0, 0555, vm_table}, .ctl_name = CTL_KERN,
.procname = "kernel",
.mode = 0555,
.child = kern_table,
},
{
.ctl_name = CTL_VM,
.procname = "vm",
.mode = 0555,
.child = vm_table,
},
#ifdef CONFIG_NET #ifdef CONFIG_NET
{CTL_NET, "net", NULL, 0, 0555, net_table}, {
.ctl_name = CTL_NET,
.procname = "net",
.mode = 0555,
.child = net_table,
},
#endif #endif
{CTL_PROC, "proc", NULL, 0, 0555, proc_table}, {
{CTL_FS, "fs", NULL, 0, 0555, fs_table}, .ctl_name = CTL_PROC,
{CTL_DEBUG, "debug", NULL, 0, 0555, debug_table}, .procname = "proc",
{CTL_DEV, "dev", NULL, 0, 0555, dev_table}, .mode = 0555,
{0} .child = proc_table,
},
{
.ctl_name = CTL_FS,
.procname = "fs",
.mode = 0555,
.child = fs_table,
},
{
.ctl_name = CTL_DEBUG,
.procname = "debug",
.mode = 0555,
.child = debug_table,
},
{
.ctl_name = CTL_DEV,
.procname = "dev",
.mode = 0555,
.child = dev_table,
},
{ .ctl_name = 0 }
}; };
static ctl_table kern_table[] = { static ctl_table kern_table[] = {
{KERN_OSTYPE, "ostype", system_utsname.sysname, 64, {
0444, NULL, &proc_doutsstring, &sysctl_string}, .ctl_name = KERN_OSTYPE,
{KERN_OSRELEASE, "osrelease", system_utsname.release, 64, .procname = "ostype",
0444, NULL, &proc_doutsstring, &sysctl_string}, .data = system_utsname.sysname,
{KERN_VERSION, "version", system_utsname.version, 64, .maxlen = 64,
0444, NULL, &proc_doutsstring, &sysctl_string}, .mode = 0444,
{KERN_NODENAME, "hostname", system_utsname.nodename, 64, .proc_handler = &proc_doutsstring,
0644, NULL, &proc_doutsstring, &sysctl_string}, .strategy = &sysctl_string,
{KERN_DOMAINNAME, "domainname", system_utsname.domainname, 64, },
0644, NULL, &proc_doutsstring, &sysctl_string}, {
{KERN_PANIC, "panic", &panic_timeout, sizeof(int), .ctl_name = KERN_OSRELEASE,
0644, NULL, &proc_dointvec}, .procname = "osrelease",
{KERN_CORE_USES_PID, "core_uses_pid", &core_uses_pid, sizeof(int), .data = system_utsname.release,
0644, NULL, &proc_dointvec}, .maxlen = 64,
{KERN_CORE_PATTERN, "core_pattern", core_pattern, 64, .mode = 0444,
0644, NULL, &proc_dostring, &sysctl_string}, .proc_handler = &proc_doutsstring,
{KERN_TAINTED, "tainted", &tainted, sizeof(int), .strategy = &sysctl_string,
0644, NULL, &proc_dointvec}, },
{KERN_CAP_BSET, "cap-bound", &cap_bset, sizeof(kernel_cap_t), {
0600, NULL, &proc_dointvec_bset}, .ctl_name = KERN_VERSION,
.procname = "version",
.data = system_utsname.version,
.maxlen = 64,
.mode = 0444,
.proc_handler = &proc_doutsstring,
.strategy = &sysctl_string,
},
{
.ctl_name = KERN_NODENAME,
.procname = "hostname",
.data = system_utsname.nodename,
.maxlen = 64,
.mode = 0644,
.proc_handler = &proc_doutsstring,
.strategy = &sysctl_string,
},
{
.ctl_name = KERN_DOMAINNAME,
.procname = "domainname",
.data = system_utsname.domainname,
.maxlen = 64,
.mode = 0644,
.proc_handler = &proc_doutsstring,
.strategy = &sysctl_string,
},
{
.ctl_name = KERN_PANIC,
.procname = "panic",
.data = &panic_timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = KERN_CORE_USES_PID,
.procname = "core_uses_pid",
.data = &core_uses_pid,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = KERN_CORE_PATTERN,
.procname = "core_pattern",
.data = core_pattern,
.maxlen = 64,
.mode = 0644,
.proc_handler = &proc_dostring,
.strategy = &sysctl_string,
},
{
.ctl_name = KERN_TAINTED,
.procname = "tainted",
.data = &tainted,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = KERN_CAP_BSET,
.procname = "cap-bound",
.data = &cap_bset,
.maxlen = sizeof(kernel_cap_t),
.mode = 0600,
.proc_handler = &proc_dointvec_bset,
},
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
{KERN_REALROOTDEV, "real-root-dev", &real_root_dev, sizeof(int), {
0644, NULL, &proc_dointvec}, .ctl_name = KERN_REALROOTDEV,
.procname = "real-root-dev",
.data = &real_root_dev,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
#endif #endif
#ifdef __sparc__ #ifdef __sparc__
{KERN_SPARC_REBOOT, "reboot-cmd", reboot_command, {
256, 0644, NULL, &proc_dostring, &sysctl_string }, .ctl_name = KERN_SPARC_REBOOT,
{KERN_SPARC_STOP_A, "stop-a", &stop_a_enabled, sizeof (int), .procname = "reboot-cmd",
0644, NULL, &proc_dointvec}, .data = reboot_command,
.maxlen = 256,
.mode = 0644,
.proc_handler = &proc_dostring,
.strategy = &sysctl_string,
},
{
.ctl_name = KERN_SPARC_STOP_A,
.procname = "stop-a",
.data = &stop_a_enabled,
.maxlen = sizeof (int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
#endif #endif
#if defined(CONFIG_PPC32) && defined(CONFIG_6xx) #if defined(CONFIG_PPC32) && defined(CONFIG_6xx)
{KERN_PPC_POWERSAVE_NAP, "powersave-nap", &powersave_nap, sizeof(int), {
0644, NULL, &proc_dointvec}, .ctl_name = KERN_PPC_POWERSAVE_NAP,
{KERN_PPC_L2CR, "l2cr", NULL, 0, .procname = "powersave-nap",
0644, NULL, &proc_dol2crvec}, .data = &powersave_nap,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = KERN_PPC_L2CR,
.procname = "l2cr",
.mode = 0644,
.proc_handler = &proc_dol2crvec,
},
#endif #endif
{KERN_CTLALTDEL, "ctrl-alt-del", &C_A_D, sizeof(int), {
0644, NULL, &proc_dointvec}, .ctl_name = KERN_CTLALTDEL,
{KERN_PRINTK, "printk", &console_loglevel, 4*sizeof(int), .procname = "ctrl-alt-del",
0644, NULL, &proc_dointvec}, .data = &C_A_D,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = KERN_PRINTK,
.procname = "printk",
.data = &console_loglevel,
.maxlen = 4*sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
#ifdef CONFIG_KMOD #ifdef CONFIG_KMOD
{KERN_MODPROBE, "modprobe", &modprobe_path, 256, {
0644, NULL, &proc_dostring, &sysctl_string }, .ctl_name = KERN_MODPROBE,
.procname = "modprobe",
.data = &modprobe_path,
.maxlen = 256,
.mode = 0644,
.proc_handler = &proc_dostring,
.strategy = &sysctl_string,
},
#endif #endif
#ifdef CONFIG_HOTPLUG #ifdef CONFIG_HOTPLUG
{KERN_HOTPLUG, "hotplug", &hotplug_path, 256, {
0644, NULL, &proc_dostring, &sysctl_string }, .ctl_name = KERN_HOTPLUG,
.procname = "hotplug",
.data = &hotplug_path,
.maxlen = 256,
.mode = 0644,
.proc_handler = &proc_dostring,
.strategy = &sysctl_string,
},
#endif #endif
#ifdef CONFIG_CHR_DEV_SG #ifdef CONFIG_CHR_DEV_SG
{KERN_SG_BIG_BUFF, "sg-big-buff", &sg_big_buff, sizeof (int), {
0444, NULL, &proc_dointvec}, .ctl_name = KERN_SG_BIG_BUFF,
.procname = "sg-big-buff",
.data = &sg_big_buff,
.maxlen = sizeof (int),
.mode = 0444,
.proc_handler = &proc_dointvec,
},
#endif #endif
#ifdef CONFIG_BSD_PROCESS_ACCT #ifdef CONFIG_BSD_PROCESS_ACCT
{KERN_ACCT, "acct", &acct_parm, 3*sizeof(int), {
0644, NULL, &proc_dointvec}, .ctl_name = KERN_ACCT,
.procname = "acct",
.data = &acct_parm,
.maxlen = 3*sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
#endif #endif
{KERN_RTSIGNR, "rtsig-nr", &nr_queued_signals, sizeof(int), {
0444, NULL, &proc_dointvec}, .ctl_name = KERN_RTSIGNR,
{KERN_RTSIGMAX, "rtsig-max", &max_queued_signals, sizeof(int), .procname = "rtsig-nr",
0644, NULL, &proc_dointvec}, .data = &nr_queued_signals,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = KERN_RTSIGMAX,
.procname = "rtsig-max",
.data = &max_queued_signals,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
#ifdef CONFIG_SYSVIPC #ifdef CONFIG_SYSVIPC
{KERN_SHMMAX, "shmmax", &shm_ctlmax, sizeof (size_t), {
0644, NULL, &proc_doulongvec_minmax}, .ctl_name = KERN_SHMMAX,
{KERN_SHMALL, "shmall", &shm_ctlall, sizeof (size_t), .procname = "shmmax",
0644, NULL, &proc_doulongvec_minmax}, .data = &shm_ctlmax,
{KERN_SHMMNI, "shmmni", &shm_ctlmni, sizeof (int), .maxlen = sizeof (size_t),
0644, NULL, &proc_dointvec}, .mode = 0644,
{KERN_MSGMAX, "msgmax", &msg_ctlmax, sizeof (int), .proc_handler = &proc_doulongvec_minmax,
0644, NULL, &proc_dointvec}, },
{KERN_MSGMNI, "msgmni", &msg_ctlmni, sizeof (int), {
0644, NULL, &proc_dointvec}, .ctl_name = KERN_SHMALL,
{KERN_MSGMNB, "msgmnb", &msg_ctlmnb, sizeof (int), .procname = "shmall",
0644, NULL, &proc_dointvec}, .data = &shm_ctlall,
{KERN_SEM, "sem", &sem_ctls, 4*sizeof (int), .maxlen = sizeof (size_t),
0644, NULL, &proc_dointvec}, .mode = 0644,
.proc_handler = &proc_doulongvec_minmax,
},
{
.ctl_name = KERN_SHMMNI,
.procname = "shmmni",
.data = &shm_ctlmni,
.maxlen = sizeof (int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = KERN_MSGMAX,
.procname = "msgmax",
.data = &msg_ctlmax,
.maxlen = sizeof (int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = KERN_MSGMNI,
.procname = "msgmni",
.data = &msg_ctlmni,
.maxlen = sizeof (int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = KERN_MSGMNB,
.procname = "msgmnb",
.data = &msg_ctlmnb,
.maxlen = sizeof (int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = KERN_SEM,
.procname = "sem",
.data = &sem_ctls,
.maxlen = 4*sizeof (int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
#endif #endif
#ifdef CONFIG_MAGIC_SYSRQ #ifdef CONFIG_MAGIC_SYSRQ
{KERN_SYSRQ, "sysrq", &sysrq_enabled, sizeof (int), {
0644, NULL, &proc_dointvec}, .ctl_name = KERN_SYSRQ,
.procname = "sysrq",
.data = &sysrq_enabled,
.maxlen = sizeof (int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
#endif #endif
{KERN_CADPID, "cad_pid", &cad_pid, sizeof (int), {
0600, NULL, &proc_dointvec}, .ctl_name = KERN_CADPID,
{KERN_MAX_THREADS, "threads-max", &max_threads, sizeof(int), .procname = "cad_pid",
0644, NULL, &proc_dointvec}, .data = &cad_pid,
{KERN_RANDOM, "random", NULL, 0, 0555, random_table}, .maxlen = sizeof (int),
{KERN_OVERFLOWUID, "overflowuid", &overflowuid, sizeof(int), 0644, NULL, .mode = 0600,
&proc_dointvec_minmax, &sysctl_intvec, NULL, .proc_handler = &proc_dointvec,
&minolduid, &maxolduid}, },
{KERN_OVERFLOWGID, "overflowgid", &overflowgid, sizeof(int), 0644, NULL, {
&proc_dointvec_minmax, &sysctl_intvec, NULL, .ctl_name = KERN_MAX_THREADS,
&minolduid, &maxolduid}, .procname = "threads-max",
.data = &max_threads,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = KERN_RANDOM,
.procname = "random",
.mode = 0555,
.child = random_table,
},
{
.ctl_name = KERN_OVERFLOWUID,
.procname = "overflowuid",
.data = &overflowuid,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &minolduid,
.extra2 = &maxolduid,
},
{
.ctl_name = KERN_OVERFLOWGID,
.procname = "overflowgid",
.data = &overflowgid,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &minolduid,
.extra2 = &maxolduid,
},
#ifdef CONFIG_ARCH_S390 #ifdef CONFIG_ARCH_S390
#ifdef CONFIG_MATHEMU #ifdef CONFIG_MATHEMU
{KERN_IEEE_EMULATION_WARNINGS,"ieee_emulation_warnings", {
&sysctl_ieee_emulation_warnings,sizeof(int),0644,NULL,&proc_dointvec}, .ctl_name = KERN_IEEE_EMULATION_WARNINGS,
.procname = "ieee_emulation_warnings",
.data = &sysctl_ieee_emulation_warnings,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
#endif #endif
{KERN_S390_USER_DEBUG_LOGGING,"userprocess_debug", {
&sysctl_userprocess_debug,sizeof(int),0644,NULL,&proc_dointvec}, .ctl_name = KERN_S390_USER_DEBUG_LOGGING,
.procname = "userprocess_debug",
.data = &sysctl_userprocess_debug,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
#endif #endif
{KERN_PIDMAX, "pid_max", &pid_max, sizeof (int), {
0600, NULL, &proc_dointvec}, .ctl_name = KERN_PIDMAX,
{KERN_PANIC_ON_OOPS,"panic_on_oops", .procname = "pid_max",
&panic_on_oops,sizeof(int),0644,NULL,&proc_dointvec}, .data = &pid_max,
{0} .maxlen = sizeof (int),
.mode = 0600,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = KERN_PANIC_ON_OOPS,
.procname = "panic_on_oops",
.data = &panic_on_oops,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{ .ctl_name = 0 }
}; };
/* Constants for minimum and maximum testing in vm_table. /* Constants for minimum and maximum testing in vm_table.
...@@ -275,79 +560,210 @@ static int one_hundred = 100; ...@@ -275,79 +560,210 @@ static int one_hundred = 100;
static ctl_table vm_table[] = { static ctl_table vm_table[] = {
{VM_OVERCOMMIT_MEMORY, "overcommit_memory", &sysctl_overcommit_memory, {
sizeof(sysctl_overcommit_memory), 0644, NULL, &proc_dointvec}, .ctl_name = VM_OVERCOMMIT_MEMORY,
{VM_OVERCOMMIT_RATIO, "overcommit_ratio", .procname = "overcommit_memory",
&sysctl_overcommit_ratio, sizeof(sysctl_overcommit_ratio), 0644, .data = &sysctl_overcommit_memory,
NULL, &proc_dointvec}, .maxlen = sizeof(sysctl_overcommit_memory),
{VM_PAGE_CLUSTER, "page-cluster", .mode = 0644,
&page_cluster, sizeof(int), 0644, NULL, &proc_dointvec}, .proc_handler = &proc_dointvec,
{VM_DIRTY_BACKGROUND, "dirty_background_ratio", },
&dirty_background_ratio, sizeof(dirty_background_ratio), {
0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, .ctl_name = VM_OVERCOMMIT_RATIO,
&zero, &one_hundred }, .procname = "overcommit_ratio",
{VM_DIRTY_RATIO, "dirty_ratio", &vm_dirty_ratio, .data = &sysctl_overcommit_ratio,
sizeof(vm_dirty_ratio), 0644, NULL, &proc_dointvec_minmax, .maxlen = sizeof(sysctl_overcommit_ratio),
&sysctl_intvec, NULL, &zero, &one_hundred }, .mode = 0644,
{VM_DIRTY_WB_CS, "dirty_writeback_centisecs", .proc_handler = &proc_dointvec,
&dirty_writeback_centisecs, sizeof(dirty_writeback_centisecs), 0644, },
NULL, dirty_writeback_centisecs_handler }, {
{VM_DIRTY_EXPIRE_CS, "dirty_expire_centisecs", .ctl_name = VM_PAGE_CLUSTER,
&dirty_expire_centisecs, sizeof(dirty_expire_centisecs), 0644, .procname = "page-cluster",
NULL, &proc_dointvec}, .data = &page_cluster,
{ VM_NR_PDFLUSH_THREADS, "nr_pdflush_threads", .maxlen = sizeof(int),
&nr_pdflush_threads, sizeof nr_pdflush_threads, .mode = 0644,
0444 /* read-only*/, NULL, &proc_dointvec}, .proc_handler = &proc_dointvec,
{VM_SWAPPINESS, "swappiness", &vm_swappiness, sizeof(vm_swappiness), },
0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &zero, {
&one_hundred }, .ctl_name = VM_DIRTY_BACKGROUND,
.procname = "dirty_background_ratio",
.data = &dirty_background_ratio,
.maxlen = sizeof(dirty_background_ratio),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &zero,
.extra2 = &one_hundred,
},
{
.ctl_name = VM_DIRTY_RATIO,
.procname = "dirty_ratio",
.data = &vm_dirty_ratio,
.maxlen = sizeof(vm_dirty_ratio),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &zero,
.extra2 = &one_hundred,
},
{
.ctl_name = VM_DIRTY_WB_CS,
.procname = "dirty_writeback_centisecs",
.data = &dirty_writeback_centisecs,
.maxlen = sizeof(dirty_writeback_centisecs),
.mode = 0644,
.proc_handler = dirty_writeback_centisecs_handler,
},
{
.ctl_name = VM_DIRTY_EXPIRE_CS,
.procname = "dirty_expire_centisecs",
.data = &dirty_expire_centisecs,
.maxlen = sizeof(dirty_expire_centisecs),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = VM_NR_PDFLUSH_THREADS,
.procname = "nr_pdflush_threads",
.data = &nr_pdflush_threads,
.maxlen = sizeof nr_pdflush_threads,
.mode = 0444 /* read-only*/,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = VM_SWAPPINESS,
.procname = "swappiness",
.data = &vm_swappiness,
.maxlen = sizeof(vm_swappiness),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &zero,
.extra2 = &one_hundred,
},
#ifdef CONFIG_HUGETLB_PAGE #ifdef CONFIG_HUGETLB_PAGE
{VM_HUGETLB_PAGES, "nr_hugepages", &htlbpage_max, sizeof(int), 0644, {
NULL, &hugetlb_sysctl_handler}, .ctl_name = VM_HUGETLB_PAGES,
.procname = "nr_hugepages",
.data = &htlbpage_max,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &hugetlb_sysctl_handler,
},
#endif #endif
{VM_LOWER_ZONE_PROTECTION, "lower_zone_protection", {
&sysctl_lower_zone_protection, sizeof(sysctl_lower_zone_protection), .ctl_name = VM_LOWER_ZONE_PROTECTION,
0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &zero, .procname = "lower_zone_protection",
NULL, }, .data = &sysctl_lower_zone_protection,
{0} .maxlen = sizeof(sysctl_lower_zone_protection),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &zero,
},
{ .ctl_name = 0 }
}; };
static ctl_table proc_table[] = { static ctl_table proc_table[] = {
{0} { .ctl_name = 0 }
}; };
static ctl_table fs_table[] = { static ctl_table fs_table[] = {
{FS_NRINODE, "inode-nr", &inodes_stat, 2*sizeof(int), {
0444, NULL, &proc_dointvec}, .ctl_name = FS_NRINODE,
{FS_STATINODE, "inode-state", &inodes_stat, 7*sizeof(int), .procname = "inode-nr",
0444, NULL, &proc_dointvec}, .data = &inodes_stat,
{FS_NRFILE, "file-nr", &files_stat, 3*sizeof(int), .maxlen = 2*sizeof(int),
0444, NULL, &proc_dointvec}, .mode = 0444,
{FS_MAXFILE, "file-max", &files_stat.max_files, sizeof(int), .proc_handler = &proc_dointvec,
0644, NULL, &proc_dointvec}, },
{FS_DENTRY, "dentry-state", &dentry_stat, 6*sizeof(int), {
0444, NULL, &proc_dointvec}, .ctl_name = FS_STATINODE,
{FS_OVERFLOWUID, "overflowuid", &fs_overflowuid, sizeof(int), 0644, NULL, .procname = "inode-state",
&proc_dointvec_minmax, &sysctl_intvec, NULL, .data = &inodes_stat,
&minolduid, &maxolduid}, .maxlen = 7*sizeof(int),
{FS_OVERFLOWGID, "overflowgid", &fs_overflowgid, sizeof(int), 0644, NULL, .mode = 0444,
&proc_dointvec_minmax, &sysctl_intvec, NULL, .proc_handler = &proc_dointvec,
&minolduid, &maxolduid}, },
{FS_LEASES, "leases-enable", &leases_enable, sizeof(int), {
0644, NULL, &proc_dointvec}, .ctl_name = FS_NRFILE,
{FS_DIR_NOTIFY, "dir-notify-enable", &dir_notify_enable, .procname = "file-nr",
sizeof(int), 0644, NULL, &proc_dointvec}, .data = &files_stat,
{FS_LEASE_TIME, "lease-break-time", &lease_break_time, sizeof(int), .maxlen = 3*sizeof(int),
0644, NULL, &proc_dointvec}, .mode = 0444,
{0} .proc_handler = &proc_dointvec,
},
{
.ctl_name = FS_MAXFILE,
.procname = "file-max",
.data = &files_stat.max_files,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = FS_DENTRY,
.procname = "dentry-state",
.data = &dentry_stat,
.maxlen = 6*sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = FS_OVERFLOWUID,
.procname = "overflowuid",
.data = &fs_overflowuid,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &minolduid,
.extra2 = &maxolduid,
},
{
.ctl_name = FS_OVERFLOWGID,
.procname = "overflowgid",
.data = &fs_overflowgid,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &minolduid,
.extra2 = &maxolduid,
},
{
.ctl_name = FS_LEASES,
.procname = "leases-enable",
.data = &leases_enable,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = FS_DIR_NOTIFY,
.procname = "dir-notify-enable",
.data = &dir_notify_enable,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = FS_LEASE_TIME,
.procname = "lease-break-time",
.data = &lease_break_time,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec,
},
{ .ctl_name = 0 }
}; };
static ctl_table debug_table[] = { static ctl_table debug_table[] = {
{0} { .ctl_name = 0 }
}; };
static ctl_table dev_table[] = { static ctl_table dev_table[] = {
{0} { .ctl_name = 0 }
}; };
extern void init_irq_proc (void); extern void init_irq_proc (void);
......
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