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>
This commit is contained in:
Eric W. Biederman
2012-01-09 17:24:30 -08:00
parent 3cc3e04636
commit 938aaa4f92
2 changed files with 20 additions and 9 deletions

View File

@@ -1032,6 +1032,7 @@ struct ctl_table_header
struct list_head ctl_entry;
int used;
int count;
int nreg;
};
struct rcu_head rcu;
};