sysctl: Initial support for auto-unregistering sysctl tables.
Add nreg to ctl_table_header. When nreg drops to 0 the ctl_table_header
will be unregistered.
Factor out drop_sysctl_table from unregister_sysctl_table, and add
the logic for decrementing nreg.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 094bc5c..e40b8f6 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -1032,6 +1032,7 @@
struct list_head ctl_entry;
int used;
int count;
+ int nreg;
};
struct rcu_head rcu;
};