aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/client.c18
-rw-r--r--fs/nfs/internal.h1
-rw-r--r--fs/nfs/nfs3proc.c1
-rw-r--r--fs/nfs/nfs4_fs.h2
-rw-r--r--fs/nfs/nfs4proc.c1
-rw-r--r--fs/nfs/proc.c1
-rw-r--r--include/linux/nfs_xdr.h1
7 files changed, 16 insertions, 9 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index bf0f896284a8..82cb8a386a8f 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -242,6 +242,12 @@ static void nfs4_shutdown_client(struct nfs_client *clp)
242 kfree(clp->cl_implid); 242 kfree(clp->cl_implid);
243} 243}
244 244
245void nfs4_free_client(struct nfs_client *clp)
246{
247 nfs4_shutdown_client(clp);
248 nfs_free_client(clp);
249}
250
245/* idr_remove_all is not needed as all id's are removed by nfs_put_client */ 251/* idr_remove_all is not needed as all id's are removed by nfs_put_client */
246void nfs_cleanup_cb_ident_idr(struct net *net) 252void nfs_cleanup_cb_ident_idr(struct net *net)
247{ 253{
@@ -272,10 +278,6 @@ static void nfs4_destroy_server(struct nfs_server *server)
272} 278}
273 279
274#else 280#else
275static void nfs4_shutdown_client(struct nfs_client *clp)
276{
277}
278
279void nfs_cleanup_cb_ident_idr(struct net *net) 281void nfs_cleanup_cb_ident_idr(struct net *net)
280{ 282{
281} 283}
@@ -293,12 +295,10 @@ static void pnfs_init_server(struct nfs_server *server)
293/* 295/*
294 * Destroy a shared client record 296 * Destroy a shared client record
295 */ 297 */
296static void nfs_free_client(struct nfs_client *clp) 298void nfs_free_client(struct nfs_client *clp)
297{ 299{
298 dprintk("--> nfs_free_client(%u)\n", clp->rpc_ops->version); 300 dprintk("--> nfs_free_client(%u)\n", clp->rpc_ops->version);
299 301
300 nfs4_shutdown_client(clp);
301
302 nfs_fscache_release_client_cookie(clp); 302 nfs_fscache_release_client_cookie(clp);
303 303
304 /* -EIO all pending I/O */ 304 /* -EIO all pending I/O */
@@ -335,7 +335,7 @@ void nfs_put_client(struct nfs_client *clp)
335 335
336 BUG_ON(!list_empty(&clp->cl_superblocks)); 336 BUG_ON(!list_empty(&clp->cl_superblocks));
337 337
338 nfs_free_client(clp); 338 clp->rpc_ops->free_client(clp);
339 } 339 }
340} 340}
341EXPORT_SYMBOL_GPL(nfs_put_client); 341EXPORT_SYMBOL_GPL(nfs_put_client);
@@ -574,7 +574,7 @@ nfs_get_client(const struct nfs_client_initdata *cl_init,
574 if (clp) { 574 if (clp) {
575 spin_unlock(&nn->nfs_client_lock); 575 spin_unlock(&nn->nfs_client_lock);
576 if (new) 576 if (new)
577 nfs_free_client(new); 577 new->rpc_ops->free_client(new);
578 return nfs_found_client(cl_init, clp); 578 return nfs_found_client(cl_init, clp);
579 } 579 }
580 if (new) { 580 if (new) {
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 18f99ef71343..93b732523342 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -151,6 +151,7 @@ extern void nfs_clients_init(struct net *net);
151 151
152extern void nfs_cleanup_cb_ident_idr(struct net *); 152extern void nfs_cleanup_cb_ident_idr(struct net *);
153extern void nfs_put_client(struct nfs_client *); 153extern void nfs_put_client(struct nfs_client *);
154extern void nfs_free_client(struct nfs_client *);
154extern struct nfs_client *nfs4_find_client_ident(struct net *, int); 155extern struct nfs_client *nfs4_find_client_ident(struct net *, int);
155extern struct nfs_client * 156extern struct nfs_client *
156nfs4_find_client_sessionid(struct net *, const struct sockaddr *, 157nfs4_find_client_sessionid(struct net *, const struct sockaddr *,
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 4749a32e54be..4ccb34bf1732 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -935,4 +935,5 @@ const struct nfs_rpc_ops nfs_v3_clientops = {
935 .have_delegation = nfs3_have_delegation, 935 .have_delegation = nfs3_have_delegation,
936 .return_delegation = nfs3_return_delegation, 936 .return_delegation = nfs3_return_delegation,
937 .init_client = nfs_init_client, 937 .init_client = nfs_init_client,
938 .free_client = nfs_free_client,
938}; 939};
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index cc5900ac61b5..9889ee476e37 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -301,6 +301,8 @@ extern const u32 nfs4_pathconf_bitmap[2];
301extern const u32 nfs4_fsinfo_bitmap[3]; 301extern const u32 nfs4_fsinfo_bitmap[3];
302extern const u32 nfs4_fs_locations_bitmap[2]; 302extern const u32 nfs4_fs_locations_bitmap[2];
303 303
304void nfs4_free_client(struct nfs_client *);
305
304/* nfs4renewd.c */ 306/* nfs4renewd.c */
305extern void nfs4_schedule_state_renewal(struct nfs_client *); 307extern void nfs4_schedule_state_renewal(struct nfs_client *);
306extern void nfs4_renewd_prepare_shutdown(struct nfs_server *); 308extern void nfs4_renewd_prepare_shutdown(struct nfs_server *);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 035f7a0829ec..f301c53926b2 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6807,6 +6807,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
6807 .have_delegation = nfs4_have_delegation, 6807 .have_delegation = nfs4_have_delegation,
6808 .return_delegation = nfs4_inode_return_delegation, 6808 .return_delegation = nfs4_inode_return_delegation,
6809 .init_client = nfs4_init_client, 6809 .init_client = nfs4_init_client,
6810 .free_client = nfs4_free_client,
6810}; 6811};
6811 6812
6812static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = { 6813static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = {
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 16632930abd2..53620bf10969 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -791,4 +791,5 @@ const struct nfs_rpc_ops nfs_v2_clientops = {
791 .have_delegation = nfs_have_delegation, 791 .have_delegation = nfs_have_delegation,
792 .return_delegation = nfs_return_delegation, 792 .return_delegation = nfs_return_delegation,
793 .init_client = nfs_init_client, 793 .init_client = nfs_init_client,
794 .free_client = nfs_free_client,
794}; 795};
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 62235be07fb8..e61dc7235d5d 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1427,6 +1427,7 @@ struct nfs_rpc_ops {
1427 struct nfs_client * 1427 struct nfs_client *
1428 (*init_client) (struct nfs_client *, const struct rpc_timeout *, 1428 (*init_client) (struct nfs_client *, const struct rpc_timeout *,
1429 const char *, rpc_authflavor_t); 1429 const char *, rpc_authflavor_t);
1430 void (*free_client) (struct nfs_client *);
1430}; 1431};
1431 1432
1432/* 1433/*