diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-01-11 10:18:34 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-01-31 18:20:25 -0500 |
commit | 70fe25b6e1a535f09792d1ed7012036c7bd506b2 (patch) | |
tree | b02cd0caaea99c5676d93f8556a7ce82efaa1cf0 /net | |
parent | f5131257f771ad0e84cf0314a2a86b66318755a9 (diff) |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/clnt.c | 19 |
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) | |||
109 | static void rpc_clnt_remove_pipedir(struct rpc_clnt *clnt) | 109 | static void rpc_clnt_remove_pipedir(struct rpc_clnt *clnt) |
110 | { | 110 | { |
111 | struct super_block *pipefs_sb; | 111 | struct super_block *pipefs_sb; |
112 | int put_mnt = 0; | ||
113 | 112 | ||
114 | pipefs_sb = rpc_get_sb_net(clnt->cl_xprt->xprt_net); | 113 | pipefs_sb = rpc_get_sb_net(clnt->cl_xprt->xprt_net); |
115 | if (pipefs_sb) { | 114 | if (pipefs_sb) { |
116 | if (clnt->cl_path.dentry) | ||
117 | put_mnt = 1; | ||
118 | __rpc_clnt_remove_pipedir(clnt); | 115 | __rpc_clnt_remove_pipedir(clnt); |
119 | rpc_put_sb_net(clnt->cl_xprt->xprt_net); | 116 | rpc_put_sb_net(clnt->cl_xprt->xprt_net); |
120 | } | 117 | } |
121 | if (put_mnt) | ||
122 | rpc_put_mount(); | ||
123 | } | 118 | } |
124 | 119 | ||
125 | static struct dentry *rpc_setup_pipedir_sb(struct super_block *sb, | 120 | 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) | |||
165 | clnt->cl_path.dentry = NULL; | 160 | clnt->cl_path.dentry = NULL; |
166 | if (dir_name == NULL) | 161 | if (dir_name == NULL) |
167 | return 0; | 162 | return 0; |
168 | |||
169 | path.mnt = rpc_get_mount(); | ||
170 | if (IS_ERR(path.mnt)) | ||
171 | return PTR_ERR(path.mnt); | ||
172 | pipefs_sb = rpc_get_sb_net(clnt->cl_xprt->xprt_net); | 163 | pipefs_sb = rpc_get_sb_net(clnt->cl_xprt->xprt_net); |
173 | if (!pipefs_sb) { | 164 | if (!pipefs_sb) |
174 | rpc_put_mount(); | 165 | return 0; |
175 | return -ENOENT; | ||
176 | } | ||
177 | path.dentry = rpc_setup_pipedir_sb(pipefs_sb, clnt, dir_name); | 166 | path.dentry = rpc_setup_pipedir_sb(pipefs_sb, clnt, dir_name); |
178 | rpc_put_sb_net(clnt->cl_xprt->xprt_net); | 167 | rpc_put_sb_net(clnt->cl_xprt->xprt_net); |
179 | if (IS_ERR(path.dentry)) { | 168 | if (IS_ERR(path.dentry)) |
180 | rpc_put_mount(); | ||
181 | return PTR_ERR(path.dentry); | 169 | return PTR_ERR(path.dentry); |
182 | } | ||
183 | clnt->cl_path = path; | 170 | clnt->cl_path = path; |
184 | return 0; | 171 | return 0; |
185 | } | 172 | } |