diff options
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r-- | fs/nfs/client.c | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index ee77713ce68b..a8766c4ef2e0 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/vfs.h> | 35 | #include <linux/vfs.h> |
36 | #include <linux/inet.h> | 36 | #include <linux/inet.h> |
37 | #include <linux/in6.h> | 37 | #include <linux/in6.h> |
38 | #include <linux/slab.h> | ||
38 | #include <net/ipv6.h> | 39 | #include <net/ipv6.h> |
39 | #include <linux/nfs_xdr.h> | 40 | #include <linux/nfs_xdr.h> |
40 | #include <linux/sunrpc/bc_xprt.h> | 41 | #include <linux/sunrpc/bc_xprt.h> |
@@ -164,30 +165,7 @@ error_0: | |||
164 | return ERR_PTR(err); | 165 | return ERR_PTR(err); |
165 | } | 166 | } |
166 | 167 | ||
167 | static void nfs4_shutdown_client(struct nfs_client *clp) | ||
168 | { | ||
169 | #ifdef CONFIG_NFS_V4 | ||
170 | if (__test_and_clear_bit(NFS_CS_RENEWD, &clp->cl_res_state)) | ||
171 | nfs4_kill_renewd(clp); | ||
172 | BUG_ON(!RB_EMPTY_ROOT(&clp->cl_state_owners)); | ||
173 | if (__test_and_clear_bit(NFS_CS_IDMAP, &clp->cl_res_state)) | ||
174 | nfs_idmap_delete(clp); | ||
175 | |||
176 | rpc_destroy_wait_queue(&clp->cl_rpcwaitq); | ||
177 | #endif | ||
178 | } | ||
179 | |||
180 | /* | ||
181 | * Destroy the NFS4 callback service | ||
182 | */ | ||
183 | static void nfs4_destroy_callback(struct nfs_client *clp) | ||
184 | { | ||
185 | #ifdef CONFIG_NFS_V4 | 168 | #ifdef CONFIG_NFS_V4 |
186 | if (__test_and_clear_bit(NFS_CS_CALLBACK, &clp->cl_res_state)) | ||
187 | nfs_callback_down(clp->cl_minorversion); | ||
188 | #endif /* CONFIG_NFS_V4 */ | ||
189 | } | ||
190 | |||
191 | /* | 169 | /* |
192 | * Clears/puts all minor version specific parts from an nfs_client struct | 170 | * Clears/puts all minor version specific parts from an nfs_client struct |
193 | * reverting it to minorversion 0. | 171 | * reverting it to minorversion 0. |
@@ -202,9 +180,33 @@ static void nfs4_clear_client_minor_version(struct nfs_client *clp) | |||
202 | 180 | ||
203 | clp->cl_call_sync = _nfs4_call_sync; | 181 | clp->cl_call_sync = _nfs4_call_sync; |
204 | #endif /* CONFIG_NFS_V4_1 */ | 182 | #endif /* CONFIG_NFS_V4_1 */ |
183 | } | ||
184 | |||
185 | /* | ||
186 | * Destroy the NFS4 callback service | ||
187 | */ | ||
188 | static void nfs4_destroy_callback(struct nfs_client *clp) | ||
189 | { | ||
190 | if (__test_and_clear_bit(NFS_CS_CALLBACK, &clp->cl_res_state)) | ||
191 | nfs_callback_down(clp->cl_minorversion); | ||
192 | } | ||
205 | 193 | ||
194 | static void nfs4_shutdown_client(struct nfs_client *clp) | ||
195 | { | ||
196 | if (__test_and_clear_bit(NFS_CS_RENEWD, &clp->cl_res_state)) | ||
197 | nfs4_kill_renewd(clp); | ||
198 | nfs4_clear_client_minor_version(clp); | ||
206 | nfs4_destroy_callback(clp); | 199 | nfs4_destroy_callback(clp); |
200 | if (__test_and_clear_bit(NFS_CS_IDMAP, &clp->cl_res_state)) | ||
201 | nfs_idmap_delete(clp); | ||
202 | |||
203 | rpc_destroy_wait_queue(&clp->cl_rpcwaitq); | ||
204 | } | ||
205 | #else | ||
206 | static void nfs4_shutdown_client(struct nfs_client *clp) | ||
207 | { | ||
207 | } | 208 | } |
209 | #endif /* CONFIG_NFS_V4 */ | ||
208 | 210 | ||
209 | /* | 211 | /* |
210 | * Destroy a shared client record | 212 | * Destroy a shared client record |
@@ -213,7 +215,6 @@ static void nfs_free_client(struct nfs_client *clp) | |||
213 | { | 215 | { |
214 | dprintk("--> nfs_free_client(%u)\n", clp->rpc_ops->version); | 216 | dprintk("--> nfs_free_client(%u)\n", clp->rpc_ops->version); |
215 | 217 | ||
216 | nfs4_clear_client_minor_version(clp); | ||
217 | nfs4_shutdown_client(clp); | 218 | nfs4_shutdown_client(clp); |
218 | 219 | ||
219 | nfs_fscache_release_client_cookie(clp); | 220 | nfs_fscache_release_client_cookie(clp); |
@@ -1293,7 +1294,8 @@ static int nfs4_init_server(struct nfs_server *server, | |||
1293 | 1294 | ||
1294 | /* Initialise the client representation from the mount data */ | 1295 | /* Initialise the client representation from the mount data */ |
1295 | server->flags = data->flags; | 1296 | server->flags = data->flags; |
1296 | server->caps |= NFS_CAP_ATOMIC_OPEN|NFS_CAP_CHANGE_ATTR; | 1297 | server->caps |= NFS_CAP_ATOMIC_OPEN|NFS_CAP_CHANGE_ATTR| |
1298 | NFS_CAP_POSIX_LOCK; | ||
1297 | server->options = data->options; | 1299 | server->options = data->options; |
1298 | 1300 | ||
1299 | /* Get a client record */ | 1301 | /* Get a client record */ |