Skip to content

Commit

Permalink
sysctl: Remember the ctl_table we passed to register_sysctl_paths
Browse files Browse the repository at this point in the history
By doing this we allow users of register_sysctl_paths that build
and dynamically allocate their ctl_table to be simpler.  This allows
them to just remember the ctl_table_header returned from
register_sysctl_paths from which they can now find the
ctl_table array they need to free.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Serge Hallyn <serue@us.ibm.com>
Cc: Daniel Lezcano <dlezcano@fr.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Jan 28, 2008
1 parent 29e796f commit 23eb06d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/linux/sysctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,7 @@ struct ctl_table_header
struct list_head ctl_entry;
int used;
struct completion *unregistering;
struct ctl_table *ctl_table_arg;
};

/* struct ctl_path describes where in the hierarchy a table is added */
Expand Down
1 change: 1 addition & 0 deletions kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,7 @@ struct ctl_table_header *register_sysctl_paths(const struct ctl_path *path,
new += 2;
}
*prevp = table;
header->ctl_table_arg = table;

INIT_LIST_HEAD(&header->ctl_entry);
header->used = 0;
Expand Down

0 comments on commit 23eb06d

Please sign in to comment.