Skip to contentSkip to conversation

kNFSd - 7 of 8 - Do NFSv4 server state initialisation when nfsd starts instead of when module loaded.

PATCH New NeilBrown 1 participant 1 message Jun 17, 2003

Subsystems (2)
lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 kNFSd - 7 of 8 - Do NFSv4 server state initialisation when nfsd starts instead of when module loaded.

### Comments for ChangeSet

From: "William A.(Andy) Adamson" <[email protected]>

----------- Diffstat output ------------

 ./fs/nfsd/nfs4state.c |    5 +++++
 ./fs/nfsd/nfsctl.c    |    1 -
 ./fs/nfsd/nfssvc.c    |    1 +
 3 files changed, 6 insertions(+), 1 deletion(-)
fs/nfsd/nfs4state.c renamed from fs/nfsd/nfs4state.c~current~ +5 -0
diff ./fs/nfsd/nfs4state.c~current~ ./fs/nfsd/nfs4state.c
@@ -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",
fs/nfsd/nfsctl.c renamed from fs/nfsd/nfsctl.c~current~ +0 -1
diff ./fs/nfsd/nfsctl.c~current~ ./fs/nfsd/nfsctl.c
@@ -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);
fs/nfsd/nfssvc.c renamed from fs/nfsd/nfssvc.c~current~ +1 -0
diff ./fs/nfsd/nfssvc.c~current~ ./fs/nfsd/nfssvc.c
@@ -91,6 +91,7 @@ nfsd_svc(unsigned short port, int nrserv
 	
 	/* 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) {

-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs