Commit eaee716b authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] kNFSd: Do NFSv4 server state initialisation when nfsd starts instead of when module loaded.

From: "William A.(Andy) Adamson" <andros@citi.umich.edu>
parent 1ac4906c
......@@ -55,6 +55,7 @@ time_t boot_time;
static u32 current_clientid = 1;
static u32 current_ownerid = 0;
static u32 current_fileid = 0;
static u32 nfs4_init = 0;
/* debug counters */
u32 list_add_perfile = 0;
......@@ -1158,6 +1159,8 @@ nfs4_state_init(void)
{
int i;
if (nfs4_init)
return;
for (i = 0; i < CLIENT_HASH_SIZE; i++) {
INIT_LIST_HEAD(&conf_id_hashtbl[i]);
INIT_LIST_HEAD(&conf_str_hashtbl[i]);
......@@ -1175,6 +1178,7 @@ nfs4_state_init(void)
boot_time = get_seconds();
INIT_WORK(&laundromat_work,laundromat_main, NULL);
schedule_delayed_work(&laundromat_work, NFSD_LEASE_TIME*HZ);
nfs4_init = 1;
}
......@@ -1197,6 +1201,7 @@ __nfs4_state_shutdown(void)
release_all_files();
cancel_delayed_work(&laundromat_work);
flush_scheduled_work();
nfs4_init = 0;
dprintk("NFSD: list_add_perfile %d list_del_perfile %d\n",
list_add_perfile, list_del_perfile);
dprintk("NFSD: add_perclient %d del_perclient %d\n",
......
......@@ -453,7 +453,6 @@ static int __init init_nfsd(void)
nfsd_cache_init(); /* RPC reply cache */
nfsd_export_init(); /* Exports table */
nfsd_lockd_init(); /* lockd->nfsd callbacks */
nfs4_state_init(); /* NFSv4 State */
if (proc_mkdir("fs/nfs", 0)) {
struct proc_dir_entry *entry;
entry = create_proc_entry("fs/nfs/exports", 0, NULL);
......
......@@ -91,6 +91,7 @@ nfsd_svc(unsigned short port, int nrservs)
/* Readahead param cache - will no-op if it already exists */
error = nfsd_racache_init(2*nrservs);
nfs4_state_init();
if (error<0)
goto out;
if (!nfsd_serv) {
......
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