[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111214104505.3991.45390.stgit@localhost6.localdomain6>
Date: Wed, 14 Dec 2011 14:45:05 +0300
From: Stanislav Kinsbursky <skinsbursky@...allels.com>
To: Trond.Myklebust@...app.com
Cc: linux-nfs@...r.kernel.org, xemul@...allels.com, neilb@...e.de,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
jbottomley@...allels.com, bfields@...ldses.org,
davem@...emloft.net, devel@...nvz.org
Subject: [PATCH 03/11] SUNRPC: sysctl root for debug table introduced
Sysctl root is required for handliong sysctl dentries per network namespace
context. IOW, it's "lookup" method will be used to find per-net sysctl's set in
further patches.
Also this patch modifies sysctl registering helpers to make them use new sysctl
root.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@...allels.com>
---
net/sunrpc/sysctl.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c
index 64c0034..f6e7da2 100644
--- a/net/sunrpc/sysctl.c
+++ b/net/sunrpc/sysctl.c
@@ -39,6 +39,9 @@ EXPORT_SYMBOL_GPL(nlm_debug);
#ifdef RPC_DEBUG
+#include <linux/nsproxy.h>
+#include <net/net_namespace.h>
+
static struct ctl_table_header *sunrpc_table_header;
static ctl_table debug_table[];
@@ -47,18 +50,24 @@ struct ctl_path sunrpc_path[] = {
{ },
};
+static struct ctl_table_root sunrpc_debug_root = {
+};
+
struct ctl_table_header *register_sunrpc_sysctl(struct ctl_table *table)
{
- return register_sysctl_paths(sunrpc_path, table);
-
+ return __register_sysctl_paths(&sunrpc_debug_root, current->nsproxy,
+ sunrpc_path, table);
}
EXPORT_SYMBOL_GPL(register_sunrpc_sysctl);
void
rpc_register_sysctl(void)
{
- if (!sunrpc_table_header)
+ if (!sunrpc_table_header) {
+ setup_sysctl_set(&sunrpc_debug_root.default_set, NULL, NULL);
+ register_sysctl_root(&sunrpc_debug_root);
sunrpc_table_header = register_sunrpc_sysctl(debug_table);
+ }
}
void
@@ -66,6 +75,7 @@ rpc_unregister_sysctl(void)
{
if (sunrpc_table_header) {
unregister_sysctl_table(sunrpc_table_header);
+ unregister_sysctl_root(&sunrpc_debug_root);
sunrpc_table_header = NULL;
}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists