diff options
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 3c074de902ea..af3f0cf7e278 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -102,9 +102,7 @@ static void rpc_unregister_client(struct rpc_clnt *clnt) | |||
102 | 102 | ||
103 | static void __rpc_clnt_remove_pipedir(struct rpc_clnt *clnt) | 103 | static void __rpc_clnt_remove_pipedir(struct rpc_clnt *clnt) |
104 | { | 104 | { |
105 | if (clnt->cl_dentry) | 105 | rpc_remove_client_dir(clnt); |
106 | rpc_remove_client_dir(clnt->cl_dentry, clnt); | ||
107 | clnt->cl_dentry = NULL; | ||
108 | } | 106 | } |
109 | 107 | ||
110 | static void rpc_clnt_remove_pipedir(struct rpc_clnt *clnt) | 108 | static void rpc_clnt_remove_pipedir(struct rpc_clnt *clnt) |
@@ -154,14 +152,11 @@ rpc_setup_pipedir(struct super_block *pipefs_sb, struct rpc_clnt *clnt) | |||
154 | { | 152 | { |
155 | struct dentry *dentry; | 153 | struct dentry *dentry; |
156 | 154 | ||
157 | if (clnt->cl_program->pipe_dir_name == NULL) | 155 | if (clnt->cl_program->pipe_dir_name != NULL) { |
158 | goto out; | 156 | dentry = rpc_setup_pipedir_sb(pipefs_sb, clnt); |
159 | clnt->cl_dentry = NULL; | 157 | if (IS_ERR(dentry)) |
160 | dentry = rpc_setup_pipedir_sb(pipefs_sb, clnt); | 158 | return PTR_ERR(dentry); |
161 | if (IS_ERR(dentry)) | 159 | } |
162 | return PTR_ERR(dentry); | ||
163 | clnt->cl_dentry = dentry; | ||
164 | out: | ||
165 | return 0; | 160 | return 0; |
166 | } | 161 | } |
167 | 162 | ||
@@ -170,11 +165,18 @@ static int rpc_clnt_skip_event(struct rpc_clnt *clnt, unsigned long event) | |||
170 | if (clnt->cl_program->pipe_dir_name == NULL) | 165 | if (clnt->cl_program->pipe_dir_name == NULL) |
171 | return 1; | 166 | return 1; |
172 | 167 | ||
173 | if (((event == RPC_PIPEFS_MOUNT) && clnt->cl_dentry) || | 168 | switch (event) { |
174 | ((event == RPC_PIPEFS_UMOUNT) && !clnt->cl_dentry)) | 169 | case RPC_PIPEFS_MOUNT: |
175 | return 1; | 170 | if (clnt->cl_pipedir_objects.pdh_dentry != NULL) |
176 | if ((event == RPC_PIPEFS_MOUNT) && atomic_read(&clnt->cl_count) == 0) | 171 | return 1; |
177 | return 1; | 172 | if (atomic_read(&clnt->cl_count) == 0) |
173 | return 1; | ||
174 | break; | ||
175 | case RPC_PIPEFS_UMOUNT: | ||
176 | if (clnt->cl_pipedir_objects.pdh_dentry == NULL) | ||
177 | return 1; | ||
178 | break; | ||
179 | } | ||
178 | return 0; | 180 | return 0; |
179 | } | 181 | } |
180 | 182 | ||
@@ -191,7 +193,6 @@ static int __rpc_clnt_handle_event(struct rpc_clnt *clnt, unsigned long event, | |||
191 | return -ENOENT; | 193 | return -ENOENT; |
192 | if (IS_ERR(dentry)) | 194 | if (IS_ERR(dentry)) |
193 | return PTR_ERR(dentry); | 195 | return PTR_ERR(dentry); |
194 | clnt->cl_dentry = dentry; | ||
195 | break; | 196 | break; |
196 | case RPC_PIPEFS_UMOUNT: | 197 | case RPC_PIPEFS_UMOUNT: |
197 | __rpc_clnt_remove_pipedir(clnt); | 198 | __rpc_clnt_remove_pipedir(clnt); |