diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-02-06 09:32:50 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-07-06 14:54:49 -0400 |
commit | 10b7a70cbb81a62353f763c3343ac0c48410696f (patch) | |
tree | c8be11f391439f6b72645add073f4a3763a5ea92 /fs/nfs/client.c | |
parent | 996bc4f405d37ffd88c9b830202ee47fc7a6c449 (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.c | 13 |
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: | |||
192 | EXPORT_SYMBOL_GPL(nfs_alloc_client); | 192 | EXPORT_SYMBOL_GPL(nfs_alloc_client); |
193 | 193 | ||
194 | #if IS_ENABLED(CONFIG_NFS_V4) | 194 | #if IS_ENABLED(CONFIG_NFS_V4) |
195 | void nfs_cleanup_cb_ident_idr(struct net *net) | 195 | static 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 |
217 | void nfs_cleanup_cb_ident_idr(struct net *net) | 217 | static 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 | ||
1077 | void 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 |
1078 | static void *nfs_server_list_start(struct seq_file *p, loff_t *pos); | 1087 | static void *nfs_server_list_start(struct seq_file *p, loff_t *pos); |
1079 | static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos); | 1088 | static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos); |