Clean up kern_module.c rev 1.66, thanks to pooka@ for review & suggestions

This commit is contained in:
pgoyette 2010-05-24 15:34:48 +00:00
parent 43b2175b78
commit c269eb06dd
2 changed files with 14 additions and 27 deletions

View File

@ -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 void module_enqueue(module_t *);
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 @@ module_init(void)
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 @@ module_do_load(const char *name, bool isdep, int flags,
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--;

View File

@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: kern_module_vfs.c,v 1.4 2010/04/04 17:18:04 jnemeth
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,