linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH: add quota autoload
@ 2003-07-14 12:28 Alan Cox
  0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2003-07-14 12:28 UTC (permalink / raw)
  To: linux-kernel, marcelo

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.22-pre5/fs/dquot.c linux.22-pre5-ac1/fs/dquot.c
--- linux.22-pre5/fs/dquot.c	2003-07-14 12:27:40.000000000 +0100
+++ linux.22-pre5-ac1/fs/dquot.c	2003-07-14 13:01:17.000000000 +0100
@@ -68,11 +68,13 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
+#include <linux/kmod.h>
 
 #include <asm/uaccess.h>
 
 static char *quotatypes[] = INITQFNAMES;
 static struct quota_format_type *quota_formats;	/* List of registered formats */
+static struct quota_module_name module_names[] = INIT_QUOTA_MODULE_NAMES;
 
 int register_quota_format(struct quota_format_type *fmt)
 {
@@ -100,8 +102,19 @@
 
 	lock_kernel();
 	for (actqf = quota_formats; actqf && actqf->qf_fmt_id != id; actqf = actqf->qf_next);
-	if (actqf && !try_inc_mod_count(actqf->qf_owner))
-		actqf = NULL;
+	if (!actqf || !try_inc_mod_count(actqf->qf_owner)) {
+		int qm;
+
+		for (qm = 0; module_names[qm].qm_fmt_id && module_names[qm].qm_fmt_id != id; qm++);
+		if (!module_names[qm].qm_fmt_id || request_module(module_names[qm].qm_mod_name)) {
+			actqf = NULL;
+			goto out;
+		}
+		for (actqf = quota_formats; actqf && actqf->qf_fmt_id != id; actqf = actqf->qf_next);
+		if (actqf && !try_inc_mod_count(actqf->qf_owner))
+			actqf = NULL;
+	}
+out:
 	unlock_kernel();
 	return actqf;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-14 12:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-14 12:28 PATCH: add quota autoload Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).