Skip to contentSkip to conversation

PATCH 2.4.5.3: quota initcall

PATCH Jeff Garzik 1 participant 2 messages May 18, 2001 VFS

lore
Share & tools
lore
#0 lore raw

IMHO this is an obvious change, but it is untested... dquot_hash and dqstats are correctly declared static and in BSS, and thus are automatically cleared at kernel startup.

Since quota init now just printk's a startup message, we can safely make it an initcall.

Signature · 3 lines
Jeff Garzik      | "Do you have to make light of everything?!"
Building 1024    | "I'm extremely serious about nailing your
MandrakeSoft     |  step-daughter, but other than that, yes."

Index: linux_2_4/fs/dquot.c

fs/dquot.c renamed from fs/dquot.c:1.1.1.50 +2 -4
diff -u linux_2_4/fs/dquot.c:1.1.1.50 linux_2_4/fs/dquot.c:1.1.1.50.4.1
@@ -1343,13 +1343,11 @@
 }
 
 
-void __init dquot_init_hash(void)
+static int __init dquot_init(void)
 {
 	printk(KERN_NOTICE "VFS: Diskquotas version %s initialized\n", __DQUOT_VERSION__);
-
-	memset(dquot_hash, 0, sizeof(dquot_hash));
-	memset((caddr_t)&dqstats, 0, sizeof(dqstats));
 }
+__initcall(dquot_init);
 
 /*
  * Definitions of diskquota operations.

Index: linux_2_4/init/main.c

init/main.c renamed from init/main.c:1.1.1.62 +0 -3
diff -u linux_2_4/init/main.c:1.1.1.62 linux_2_4/init/main.c:1.1.1.62.4.1
@@ -108,9 +108,6 @@
 #if defined(CONFIG_SYSVIPC)
 extern void ipc_init(void);
 #endif
-#if defined(CONFIG_QUOTA)
-extern void dquot_init_hash(void);
-#endif
 
 /*
  * Boot command-line arguments
#1 lore raw

PATCH 2.4.5.3 (try 2): quota initcall

Doh! I should really turn on that quota compile options... <brown ppr bag>

Much better patch attached.

Signature · 3 lines
Jeff Garzik      | "Do you have to make light of everything?!"
Building 1024    | "I'm extremely serious about nailing your
MandrakeSoft     |  step-daughter, but other than that, yes."

Index: linux_2_4/fs/dquot.c

fs/dquot.c renamed from fs/dquot.c:1.1.1.50 +3 -4
diff -u linux_2_4/fs/dquot.c:1.1.1.50 linux_2_4/fs/dquot.c:1.1.1.50.4.2
@@ -1343,13 +1343,12 @@
 }
 
 
-void __init dquot_init_hash(void)
+static int __init dquot_init(void)
 {
 	printk(KERN_NOTICE "VFS: Diskquotas version %s initialized\n", __DQUOT_VERSION__);
-
-	memset(dquot_hash, 0, sizeof(dquot_hash));
-	memset((caddr_t)&dqstats, 0, sizeof(dqstats));
+	return 0;
 }
+__initcall(dquot_init);
 
 /*
  * Definitions of diskquota operations.

Index: linux_2_4/init/main.c

init/main.c renamed from init/main.c:1.1.1.62 +0 -6
diff -u linux_2_4/init/main.c:1.1.1.62 linux_2_4/init/main.c:1.1.1.62.4.2
@@ -108,9 +108,6 @@
 #if defined(CONFIG_SYSVIPC)
 extern void ipc_init(void);
 #endif
-#if defined(CONFIG_QUOTA)
-extern void dquot_init_hash(void);
-#endif
 
 /*
  * Boot command-line arguments
@@ -579,9 +576,6 @@
 #endif
 #if defined(CONFIG_SYSVIPC)
 	ipc_init();
-#endif
-#if defined(CONFIG_QUOTA)
-	dquot_init_hash();
 #endif
 	check_bugs();
 	printk("POSIX conformance testing by UNIFIX\n");