Commit 90c4e829 authored by Stanislav Kinsbursky's avatar Stanislav Kinsbursky Committed by Trond Myklebust

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: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 432eb1a5
...@@ -9,6 +9,8 @@ struct cache_detail; ...@@ -9,6 +9,8 @@ struct cache_detail;
struct sunrpc_net { struct sunrpc_net {
struct proc_dir_entry *proc_net_rpc; struct proc_dir_entry *proc_net_rpc;
struct cache_detail *ip_map_cache; struct cache_detail *ip_map_cache;
struct super_block *pipefs_sb;
}; };
extern int sunrpc_net_id; extern int sunrpc_net_id;
......
...@@ -1029,6 +1029,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent) ...@@ -1029,6 +1029,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
struct inode *inode; struct inode *inode;
struct dentry *root; struct dentry *root;
struct net *net = data; struct net *net = data;
struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
int err; int err;
sb->s_blocksize = PAGE_CACHE_SIZE; sb->s_blocksize = PAGE_CACHE_SIZE;
...@@ -1053,6 +1054,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent) ...@@ -1053,6 +1054,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
if (err) if (err)
goto err_depopulate; goto err_depopulate;
sb->s_fs_info = get_net(net); sb->s_fs_info = get_net(net);
sn->pipefs_sb = sb;
return 0; return 0;
err_depopulate: err_depopulate:
...@@ -1073,7 +1075,9 @@ rpc_mount(struct file_system_type *fs_type, ...@@ -1073,7 +1075,9 @@ rpc_mount(struct file_system_type *fs_type,
void rpc_kill_sb(struct super_block *sb) void rpc_kill_sb(struct super_block *sb)
{ {
struct net *net = sb->s_fs_info; struct net *net = sb->s_fs_info;
struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
sn->pipefs_sb = NULL;
put_net(net); put_net(net);
blocking_notifier_call_chain(&rpc_pipefs_notifier_list, blocking_notifier_call_chain(&rpc_pipefs_notifier_list,
RPC_PIPEFS_UMOUNT, RPC_PIPEFS_UMOUNT,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment