Module Name: src Committed By: pgoyette Date: Mon May 24 15:34:49 UTC 2010
Modified Files: src/sys/kern: kern_module.c kern_module_vfs.c Log Message: Clean up previous, thanks to pooka@ for detailed review and suggestions. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/kern/kern_module.c cvs rdiff -u -r1.4 -r1.5 src/sys/kern/kern_module_vfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kern_module.c diff -u src/sys/kern/kern_module.c:1.66 src/sys/kern/kern_module.c:1.67 --- src/sys/kern/kern_module.c:1.66 Mon May 24 03:50:25 2010 +++ src/sys/kern/kern_module.c Mon May 24 15:34:48 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_module.c,v 1.66 2010/05/24 03:50:25 pgoyette Exp $ */ +/* $NetBSD: kern_module.c,v 1.67 2010/05/24 15:34:48 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.66 2010/05/24 03:50:25 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.67 2010/05/24 15:34:48 pgoyette Exp $"); #define _MODULE_INTERNAL @@ -97,26 +97,6 @@ static bool module_merge_dicts(prop_dictionary_t, const prop_dictionary_t); -int module_eopnotsupp(const char *, int, bool, module_t *, - prop_dictionary_t *); - -int (*module_load_vfs_vec)(const char *, int, bool, module_t *, - prop_dictionary_t *); - -int -module_eopnotsupp(const char *name, int flags, bool autoload, module_t *mod, - prop_dictionary_t *filedictp) -{ - return EOPNOTSUPP; -} -__weak_alias(module_load_vfs,module_eopnotsupp); - -void -module_load_vfs_init(void) -{ - module_load_vfs_vec = module_load_vfs; -} - /* * module_error: * @@ -324,7 +304,6 @@ mutex_init(&module_lock, MUTEX_DEFAULT, IPL_NONE); cv_init(&module_thread_cv, "modunload"); mutex_init(&module_thread_lock, MUTEX_DEFAULT, IPL_NONE); - module_load_vfs_vec = module_eopnotsupp; #ifdef MODULAR /* XXX */ module_init_md(); @@ -858,8 +837,8 @@ return ENOMEM; } - error = (*module_load_vfs_vec)(name, flags, autoload, mod, - &filedict); + error = module_load_vfs_vec(name, flags, autoload, mod, + &filedict); if (error != 0) { kmem_free(mod, sizeof(*mod)); depth--; Index: src/sys/kern/kern_module_vfs.c diff -u src/sys/kern/kern_module_vfs.c:1.4 src/sys/kern/kern_module_vfs.c:1.5 --- src/sys/kern/kern_module_vfs.c:1.4 Sun Apr 4 17:18:04 2010 +++ src/sys/kern/kern_module_vfs.c Mon May 24 15:34:49 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_module_vfs.c,v 1.4 2010/04/04 17:18:04 jnemeth Exp $ */ +/* $NetBSD: kern_module_vfs.c,v 1.5 2010/05/24 15:34:49 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_module_vfs.c,v 1.4 2010/04/04 17:18:04 jnemeth Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_module_vfs.c,v 1.5 2010/05/24 15:34:49 pgoyette Exp $"); #define _MODULE_INTERNAL #include <sys/param.h> @@ -51,6 +51,14 @@ static int module_load_plist_vfs(const char *, const bool, prop_dictionary_t *); +int (*module_load_vfs_vec)(const char *, int, bool, module_t *, + prop_dictionary_t *) = (void *)eopnotsupp; + +void +module_load_vfs_init(void) +{ + module_load_vfs_vec = module_load_vfs; +} int module_load_vfs(const char *name, int flags, bool autoload,