summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislav Kinsbursky2012-01-11 16:18:34 +0100
committerTrond Myklebust2012-02-01 00:20:25 +0100
commit70fe25b6e1a535f09792d1ed7012036c7bd506b2 (patch)
treeb02cd0caaea99c5676d93f8556a7ce82efaa1cf0
parentSUNRPC: remove RPC client pipefs dentries after unregister (diff)
downloadkernel-qcow2-linux-70fe25b6e1a535f09792d1ed7012036c7bd506b2.tar.gz
kernel-qcow2-linux-70fe25b6e1a535f09792d1ed7012036c7bd506b2.tar.xz
kernel-qcow2-linux-70fe25b6e1a535f09792d1ed7012036c7bd506b2.zip
SUNRPC: remove RPC pipefs mount point manipulations from RPC clients code
v2: 1) Updated due to changes in the first patch of the series. Now, with RPC pipefs mount notifications handling in RPC clients, we can remove mount point creation and destruction. RPC clients dentries will be created on PipeFS mount event and removed on umount event. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--net/sunrpc/clnt.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index c89ceb80fe87..e3ced3061212 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -109,17 +109,12 @@ static void __rpc_clnt_remove_pipedir(struct rpc_clnt *clnt)
static void rpc_clnt_remove_pipedir(struct rpc_clnt *clnt)
{
struct super_block *pipefs_sb;
- int put_mnt = 0;
pipefs_sb = rpc_get_sb_net(clnt->cl_xprt->xprt_net);
if (pipefs_sb) {
- if (clnt->cl_path.dentry)
- put_mnt = 1;
__rpc_clnt_remove_pipedir(clnt);
rpc_put_sb_net(clnt->cl_xprt->xprt_net);
}
- if (put_mnt)
- rpc_put_mount();
}
static struct dentry *rpc_setup_pipedir_sb(struct super_block *sb,
@@ -165,21 +160,13 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
clnt->cl_path.dentry = NULL;
if (dir_name == NULL)
return 0;
-
- path.mnt = rpc_get_mount();
- if (IS_ERR(path.mnt))
- return PTR_ERR(path.mnt);
pipefs_sb = rpc_get_sb_net(clnt->cl_xprt->xprt_net);
- if (!pipefs_sb) {
- rpc_put_mount();
- return -ENOENT;
- }
+ if (!pipefs_sb)
+ return 0;
path.dentry = rpc_setup_pipedir_sb(pipefs_sb, clnt, dir_name);
rpc_put_sb_net(clnt->cl_xprt->xprt_net);
- if (IS_ERR(path.dentry)) {
- rpc_put_mount();
+ if (IS_ERR(path.dentry))
return PTR_ERR(path.dentry);
- }
clnt->cl_path = path;
return 0;
}