[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <844a7fc3-2cba-46d2-fd4e-e5fe16b08573@csgroup.eu>
Date: Thu, 21 Jan 2021 11:00:20 +0100
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Christoph Hellwig <hch@....de>,
Frederic Barrat <fbarrat@...ux.ibm.com>,
Andrew Donnellan <ajd@...ux.ibm.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>, Jessica Yu <jeyu@...nel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Jiri Kosina <jikos@...nel.org>,
Miroslav Benes <mbenes@...e.cz>,
Petr Mladek <pmladek@...e.com>,
Joe Lawrence <joe.lawrence@...hat.com>
Cc: Michal Marek <michal.lkml@...kovi.net>,
linux-kbuild@...r.kernel.org,
Masahiro Yamada <masahiroy@...nel.org>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
live-patching@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH 02/13] module: add a module_loaded helper
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 <hch@....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.
Powered by blists - more mailing lists