aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-02-06 09:32:50 -0500
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-07-06 14:54:49 -0400
commit10b7a70cbb81a62353f763c3343ac0c48410696f (patch)
treec8be11f391439f6b72645add073f4a3763a5ea92 /fs/nfs/client.c
parent996bc4f405d37ffd88c9b830202ee47fc7a6c449 (diff)
NFS: Cleanup - add nfs_clients_exit to mirror nfs_clients_init
Add a helper to clean up the struct nfs_net when it is being destroyed. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r--fs/nfs/client.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index d7e4f0848e28..0acb104f7b00 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -192,7 +192,7 @@ error_0:
192EXPORT_SYMBOL_GPL(nfs_alloc_client); 192EXPORT_SYMBOL_GPL(nfs_alloc_client);
193 193
194#if IS_ENABLED(CONFIG_NFS_V4) 194#if IS_ENABLED(CONFIG_NFS_V4)
195void nfs_cleanup_cb_ident_idr(struct net *net) 195static void nfs_cleanup_cb_ident_idr(struct net *net)
196{ 196{
197 struct nfs_net *nn = net_generic(net, nfs_net_id); 197 struct nfs_net *nn = net_generic(net, nfs_net_id);
198 198
@@ -214,7 +214,7 @@ static void pnfs_init_server(struct nfs_server *server)
214} 214}
215 215
216#else 216#else
217void nfs_cleanup_cb_ident_idr(struct net *net) 217static void nfs_cleanup_cb_ident_idr(struct net *net)
218{ 218{
219} 219}
220 220
@@ -1074,6 +1074,15 @@ void nfs_clients_init(struct net *net)
1074 nn->boot_time = ktime_get_real(); 1074 nn->boot_time = ktime_get_real();
1075} 1075}
1076 1076
1077void nfs_clients_exit(struct net *net)
1078{
1079 struct nfs_net *nn = net_generic(net, nfs_net_id);
1080
1081 nfs_cleanup_cb_ident_idr(net);
1082 WARN_ON_ONCE(!list_empty(&nn->nfs_client_list));
1083 WARN_ON_ONCE(!list_empty(&nn->nfs_volume_list));
1084}
1085
1077#ifdef CONFIG_PROC_FS 1086#ifdef CONFIG_PROC_FS
1078static void *nfs_server_list_start(struct seq_file *p, loff_t *pos); 1087static void *nfs_server_list_start(struct seq_file *p, loff_t *pos);
1079static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos); 1088static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos);