diff options
Diffstat (limited to 'net/sunrpc/cache.c')
-rw-r--r-- | net/sunrpc/cache.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index e84e7ddeecd4..e20968aac68a 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #include <linux/sunrpc/cache.h> | 34 | #include <linux/sunrpc/cache.h> |
35 | #include <linux/sunrpc/stats.h> | 35 | #include <linux/sunrpc/stats.h> |
36 | #include <linux/sunrpc/rpc_pipe_fs.h> | 36 | #include <linux/sunrpc/rpc_pipe_fs.h> |
37 | #include <net/net_namespace.h> | 37 | #include "netns.h" |
38 | 38 | ||
39 | #define RPCDBG_FACILITY RPCDBG_CACHE | 39 | #define RPCDBG_FACILITY RPCDBG_CACHE |
40 | 40 | ||
@@ -1540,6 +1540,8 @@ static const struct file_operations cache_flush_operations_procfs = { | |||
1540 | 1540 | ||
1541 | static void remove_cache_proc_entries(struct cache_detail *cd, struct net *net) | 1541 | static void remove_cache_proc_entries(struct cache_detail *cd, struct net *net) |
1542 | { | 1542 | { |
1543 | struct sunrpc_net *sn; | ||
1544 | |||
1543 | if (cd->u.procfs.proc_ent == NULL) | 1545 | if (cd->u.procfs.proc_ent == NULL) |
1544 | return; | 1546 | return; |
1545 | if (cd->u.procfs.flush_ent) | 1547 | if (cd->u.procfs.flush_ent) |
@@ -1549,15 +1551,18 @@ static void remove_cache_proc_entries(struct cache_detail *cd, struct net *net) | |||
1549 | if (cd->u.procfs.content_ent) | 1551 | if (cd->u.procfs.content_ent) |
1550 | remove_proc_entry("content", cd->u.procfs.proc_ent); | 1552 | remove_proc_entry("content", cd->u.procfs.proc_ent); |
1551 | cd->u.procfs.proc_ent = NULL; | 1553 | cd->u.procfs.proc_ent = NULL; |
1552 | remove_proc_entry(cd->name, proc_net_rpc); | 1554 | sn = net_generic(net, sunrpc_net_id); |
1555 | remove_proc_entry(cd->name, sn->proc_net_rpc); | ||
1553 | } | 1556 | } |
1554 | 1557 | ||
1555 | #ifdef CONFIG_PROC_FS | 1558 | #ifdef CONFIG_PROC_FS |
1556 | static int create_cache_proc_entries(struct cache_detail *cd, struct net *net) | 1559 | static int create_cache_proc_entries(struct cache_detail *cd, struct net *net) |
1557 | { | 1560 | { |
1558 | struct proc_dir_entry *p; | 1561 | struct proc_dir_entry *p; |
1562 | struct sunrpc_net *sn; | ||
1559 | 1563 | ||
1560 | cd->u.procfs.proc_ent = proc_mkdir(cd->name, proc_net_rpc); | 1564 | sn = net_generic(net, sunrpc_net_id); |
1565 | cd->u.procfs.proc_ent = proc_mkdir(cd->name, sn->proc_net_rpc); | ||
1561 | if (cd->u.procfs.proc_ent == NULL) | 1566 | if (cd->u.procfs.proc_ent == NULL) |
1562 | goto out_nomem; | 1567 | goto out_nomem; |
1563 | cd->u.procfs.channel_ent = NULL; | 1568 | cd->u.procfs.channel_ent = NULL; |