Le 21/01/2021 à 08:49, Christoph Hellwig a écrit : > Add a helper that takes modules_mutex and uses find_module to check if a > given module is loaded. This provides a better abstraction for the two > callers, and allows to unexport modules_mutex and find_module. > > Signed-off-by: Christoph Hellwig <h...@lst.de> > --- > drivers/gpu/drm/drm_fb_helper.c | 7 +------ > include/linux/module.h | 3 +++ > kernel/module.c | 14 ++++++++++++-- > kernel/trace/trace_kprobe.c | 4 +--- > 4 files changed, 17 insertions(+), 11 deletions(-) > > diff --git a/include/linux/module.h b/include/linux/module.h > index 7a0bcb5b1ffccd..b4654f8a408134 100644 > --- a/include/linux/module.h > +++ b/include/linux/module.h > @@ -589,6 +589,9 @@ static inline bool within_module(unsigned long addr, const struct module *mod) > /* Search for module by name: must hold module_mutex. */ > struct module *find_module(const char *name); > +/* Check if a module is loaded. */ > +bool module_loaded(const char *name); Maybe module_is_loaded() would be a better name.
- module loader dead code removal and cleanusp Christoph Hellwig
- [PATCH 01/13] powerpc/powernv: remove get_cxl_modul... Christoph Hellwig
- Re: [PATCH 01/13] powerpc/powernv: remove get_c... Andrew Donnellan
- [PATCH 02/13] module: add a module_loaded helper Christoph Hellwig
- Re: [PATCH 02/13] module: add a module_loaded h... Christophe Leroy
- RE: [PATCH 02/13] module: add a module_load... David Laight
- Re: [PATCH 02/13] module: add a module_... Christophe Leroy
- Re: [PATCH 02/13] module: add a module_loaded h... Christophe Leroy
- Re: [PATCH 02/13] module: add a module_load... Christoph Hellwig
- RE: [PATCH 02/13] module: add a module_... David Laight
- [PATCH 03/13] livepatch: refactor klp_init_object Christoph Hellwig
- Re: [PATCH 03/13] livepatch: refactor klp_init_... Christoph Hellwig
- Re: [PATCH 03/13] livepatch: refactor klp_i... Christoph Hellwig
- [PATCH 04/13] livepatch: move klp_find_object_modul... Christoph Hellwig
- Re: [PATCH 04/13] livepatch: move klp_find_obje... Josh Poimboeuf
- Re: [PATCH 04/13] livepatch: move klp_find_obje... Jessica Yu
- [PATCH 05/13] kallsyms: refactor {,module_}kallsyms... Christoph Hellwig
- [PATCH 06/13] kallsyms: only build {, module_}kalls... Christoph Hellwig