Commit 8b330f78 authored by Chuck Lever's avatar Chuck Lever

NFSD: Zero counters when the filecache is re-initialized

If nfsd_file_cache_init() is called after a shutdown, be sure the
stat counters are reset.
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent df2aff52
...@@ -824,6 +824,8 @@ nfsd_file_cache_shutdown_net(struct net *net) ...@@ -824,6 +824,8 @@ nfsd_file_cache_shutdown_net(struct net *net)
void void
nfsd_file_cache_shutdown(void) nfsd_file_cache_shutdown(void)
{ {
int i;
set_bit(NFSD_FILE_SHUTDOWN, &nfsd_file_lru_flags); set_bit(NFSD_FILE_SHUTDOWN, &nfsd_file_lru_flags);
lease_unregister_notifier(&nfsd_file_lease_notifier); lease_unregister_notifier(&nfsd_file_lease_notifier);
...@@ -847,6 +849,15 @@ nfsd_file_cache_shutdown(void) ...@@ -847,6 +849,15 @@ nfsd_file_cache_shutdown(void)
nfsd_file_hashtbl = NULL; nfsd_file_hashtbl = NULL;
destroy_workqueue(nfsd_filecache_wq); destroy_workqueue(nfsd_filecache_wq);
nfsd_filecache_wq = NULL; nfsd_filecache_wq = NULL;
for_each_possible_cpu(i) {
per_cpu(nfsd_file_cache_hits, i) = 0;
per_cpu(nfsd_file_acquisitions, i) = 0;
per_cpu(nfsd_file_releases, i) = 0;
per_cpu(nfsd_file_total_age, i) = 0;
per_cpu(nfsd_file_pages_flushed, i) = 0;
per_cpu(nfsd_file_evictions, i) = 0;
}
} }
static bool static bool
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment