aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2011-12-26 07:39:30 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-01-31 18:20:24 -0500
commit90c4e82999c517e0cd00d0782c68d186cb18b784 (patch)
tree61e1984458df512d72c76721d9f4fe15821a6cea /net
parent432eb1a5fb380477ae759041bac2bb305977e436 (diff)
SUNRPC: put pipefs superblock link on network namespace
We have modules (like, pNFS blocklayout module) which creates pipes on rpc_pipefs. Thus we need per-net operations for them. To make it possible we require appropriate super block. So we have to put sb link on network namespace context. Note, that it's not strongly required to create pipes in per-net operations. IOW, if pipefs wasn't mounted yet, that no sb link reference will present on network namespace and in this case we need just need to pass through pipe creation. Pipe dentry will be created during pipefs mount notification. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/netns.h2
-rw-r--r--net/sunrpc/rpc_pipe.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/net/sunrpc/netns.h b/net/sunrpc/netns.h
index d013bf211cae..b3842529aec9 100644
--- a/net/sunrpc/netns.h
+++ b/net/sunrpc/netns.h
@@ -9,6 +9,8 @@ struct cache_detail;
9struct sunrpc_net { 9struct sunrpc_net {
10 struct proc_dir_entry *proc_net_rpc; 10 struct proc_dir_entry *proc_net_rpc;
11 struct cache_detail *ip_map_cache; 11 struct cache_detail *ip_map_cache;
12
13 struct super_block *pipefs_sb;
12}; 14};
13 15
14extern int sunrpc_net_id; 16extern int sunrpc_net_id;
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 6f295e6c12a0..e5e1f357b561 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -1029,6 +1029,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
1029 struct inode *inode; 1029 struct inode *inode;
1030 struct dentry *root; 1030 struct dentry *root;
1031 struct net *net = data; 1031 struct net *net = data;
1032 struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
1032 int err; 1033 int err;
1033 1034
1034 sb->s_blocksize = PAGE_CACHE_SIZE; 1035 sb->s_blocksize = PAGE_CACHE_SIZE;
@@ -1053,6 +1054,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
1053 if (err) 1054 if (err)
1054 goto err_depopulate; 1055 goto err_depopulate;
1055 sb->s_fs_info = get_net(net); 1056 sb->s_fs_info = get_net(net);
1057 sn->pipefs_sb = sb;
1056 return 0; 1058 return 0;
1057 1059
1058err_depopulate: 1060err_depopulate:
@@ -1073,7 +1075,9 @@ rpc_mount(struct file_system_type *fs_type,
1073void rpc_kill_sb(struct super_block *sb) 1075void rpc_kill_sb(struct super_block *sb)
1074{ 1076{
1075 struct net *net = sb->s_fs_info; 1077 struct net *net = sb->s_fs_info;
1078 struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
1076 1079
1080 sn->pipefs_sb = NULL;
1077 put_net(net); 1081 put_net(net);
1078 blocking_notifier_call_chain(&rpc_pipefs_notifier_list, 1082 blocking_notifier_call_chain(&rpc_pipefs_notifier_list,
1079 RPC_PIPEFS_UMOUNT, 1083 RPC_PIPEFS_UMOUNT,