From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: Trond.Myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org, xemul@parallels.com, neilb@suse.de,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bfields@fieldses.org, davem@davemloft.net, devel@openvz.org
Subject: [RFC PATCH 4/5] SUNRPC: put pipefs superblock link on network namespace
Date: Mon, 17 Oct 2011 16:10:51 +0300 [thread overview]
Message-ID: <20111017121050.4541.25395.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20111017120629.4541.67395.stgit@localhost6.localdomain6>
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 to
create piepes in per-net operations, we require super block. So we have to put
sb link on network namespace context. Note, that dont't hardly require to
create pipes in per-net operations. IOW, if pipefs wan't mounted yet, that no
sb link reference will peresent on network namespace. In this case we just
passing through pipe
creation. The pipe will be created druing pipefs mount notification.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
net/sunrpc/netns.h | 2 ++
net/sunrpc/rpc_pipe.c | 4 ++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/net/sunrpc/netns.h b/net/sunrpc/netns.h
index d013bf2..b384252 100644
--- a/net/sunrpc/netns.h
+++ b/net/sunrpc/netns.h
@@ -9,6 +9,8 @@ struct cache_detail;
struct sunrpc_net {
struct proc_dir_entry *proc_net_rpc;
struct cache_detail *ip_map_cache;
+
+ struct super_block *pipefs_sb;
};
extern int sunrpc_net_id;
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index a8a8812..a873f03 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -1039,6 +1039,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
struct inode *inode;
struct dentry *root;
struct net *net = current->nsproxy->net_ns;
+ struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
int err;
sb->s_blocksize = PAGE_CACHE_SIZE;
@@ -1063,6 +1064,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
if (err)
goto err_depopulate;
sb->s_fs_info = get_net(net);
+ sn->pipefs_sb = sb;
return 0;
err_depopulate:
@@ -1081,7 +1083,9 @@ rpc_mount(struct file_system_type *fs_type,
void rpc_kill_sb(struct super_block *sb)
{
struct net *net = sb->s_fs_info;
+ struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
+ sn->pipefs_sb = NULL;
put_net(net);
blocking_notifier_call_chain(&rpc_pipefs_notifier_list,
RPC_PIPEFS_UMOUNT,
next prev parent reply other threads:[~2011-10-17 12:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-17 13:10 [RFC PATCH 0/5] SUNRPC: "RPC pipefs per network namespace" preparations Stanislav Kinsbursky
2011-10-17 13:10 ` [RFC PATCH 1/5] SUNRPC: hold current network namespace while pipefs superblock is active Stanislav Kinsbursky
2011-10-17 13:10 ` [RFC PATCH 2/5] SUNRPC: send notification events on pipefs sb creation and destruction Stanislav Kinsbursky
2011-10-17 13:10 ` [RFC PATCH 3/5] SUNRPC: pipefs dentry lookup helper introduced Stanislav Kinsbursky
2011-10-17 13:10 ` Stanislav Kinsbursky [this message]
2011-10-17 13:10 ` [RFC PATCH 5/5] SUNRPC: pipefs per-net operations " Stanislav Kinsbursky
2011-10-20 11:06 ` [RFC PATCH 0/5] SUNRPC: "RPC pipefs per network namespace" preparations Stanislav Kinsbursky
2011-10-20 12:32 ` bfields
2011-10-20 12:56 ` Stanislav Kinsbursky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111017121050.4541.25395.stgit@localhost6.localdomain6 \
--to=skinsbursky@parallels.com \
--cc=Trond.Myklebust@netapp.com \
--cc=bfields@fieldses.org \
--cc=davem@davemloft.net \
--cc=devel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=netdev@vger.kernel.org \
--cc=xemul@parallels.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).