summaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
commit27cfca1ec98e91261b1a5355d10a8996464b63af (patch)
tree8e895a53e372fa682b4c0a585b9377d67ed70d0e /kernel/sysctl.c
parent6a76fb7214c477ccf6582bd79c5b4ccc4f9c41b1 (diff)
Look Ma' what I found on my harddisk ...
o New faster syscalls for 2.1.x, too o Upgrade to 2.1.89. Don't try to run this. It's flaky as hell. But feel free to debug ...
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 12abcefef..1b93ad7bd 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -160,12 +160,6 @@ static ctl_table kern_table[] = {
{KERN_REALROOTDEV, "real-root-dev", &real_root_dev, sizeof(int),
0644, NULL, &proc_dointvec},
#endif
-#ifdef CONFIG_ROOT_NFS
- {KERN_NFSRNAME, "nfs-root-name", nfs_root_name, NFS_ROOT_NAME_LEN,
- 0644, NULL, &proc_dostring, &sysctl_string },
- {KERN_NFSRADDRS, "nfs-root-addrs", nfs_root_addrs, NFS_ROOT_ADDRS_LEN,
- 0644, NULL, &proc_dostring, &sysctl_string },
-#endif
#ifdef CONFIG_BINFMT_JAVA
{KERN_JAVA_INTERPRETER, "java-interpreter", binfmt_java_interpreter,
64, 0644, NULL, &proc_dostring, &sysctl_string },
@@ -441,12 +435,16 @@ struct ctl_table_header *register_sysctl_table(ctl_table * table,
return tmp;
}
-void unregister_sysctl_table(struct ctl_table_header * table)
+/*
+ * Unlink and free a ctl_table.
+ */
+void unregister_sysctl_table(struct ctl_table_header * header)
{
- DLIST_DELETE(table, ctl_entry);
+ DLIST_DELETE(header, ctl_entry);
#ifdef CONFIG_PROC_FS
- unregister_proc_table(table->ctl_table, &proc_sys_root);
+ unregister_proc_table(header->ctl_table, &proc_sys_root);
#endif
+ kfree(header);
}
/*
@@ -463,18 +461,20 @@ static void register_proc_table(ctl_table * table, struct proc_dir_entry *root)
mode_t mode;
for (; table->ctl_name; table++) {
- de = 0;
/* Can't do anything without a proc name. */
if (!table->procname)
continue;
/* Maybe we can't do anything with it... */
- if (!table->proc_handler &&
- !table->child)
+ if (!table->proc_handler && !table->child) {
+ printk(KERN_WARNING "SYSCTL: Can't register %s\n",
+ table->procname);
continue;
+ }
len = strlen(table->procname);
mode = table->mode;
+ de = NULL;
if (table->proc_handler)
mode |= S_IFREG;
else {
@@ -501,6 +501,9 @@ static void register_proc_table(ctl_table * table, struct proc_dir_entry *root)
}
}
+/*
+ * Unregister a /proc sysctl table and any subdirectories.
+ */
static void unregister_proc_table(ctl_table * table, struct proc_dir_entry *root)
{
struct proc_dir_entry *de;
@@ -518,8 +521,9 @@ static void unregister_proc_table(ctl_table * table, struct proc_dir_entry *root
entries... */
if (!((de->mode & S_IFDIR) && de->subdir)) {
proc_unregister(root, de->low_ino);
+ table->de = NULL;
kfree(de);
- }
+ }
}
}