Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763318AbXK2RyV (ORCPT ); Thu, 29 Nov 2007 12:54:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761305AbXK2RyH (ORCPT ); Thu, 29 Nov 2007 12:54:07 -0500 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:48090 "EHLO ebiederm.dsl.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761318AbXK2RyG (ORCPT ); Thu, 29 Nov 2007 12:54:06 -0500 From: ebiederm@xmission.com (Eric W. Biederman) To: Herbert Xu , Andrew Morton Cc: Serge Hallyn , Daniel Lezcano , Cedric Le Goater , Linux Containers , Pavel Emelyanov , , , David Miller , Olaf Kirch , Olaf Hering Subject: [PATCH 2/4] sysctl: Remember the ctl_table we passed to register_sysctl_paths References: <4742C73C.3010904@openvz.org> Date: Thu, 29 Nov 2007 10:46:26 -0700 In-Reply-To: (Eric W. Biederman's message of "Thu, 29 Nov 2007 10:45:10 -0700") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1463 Lines: 45 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 --- include/linux/sysctl.h | 1 + kernel/sysctl.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index eb522bf..8b2e9e0 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -1063,6 +1063,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 */ diff --git a/kernel/sysctl.c b/kernel/sysctl.c index fa92e70..effae87 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1598,6 +1598,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; -- 1.5.3.rc6.17.g1911 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/