lkml.org 
[lkml]   [2017]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 1/2] kernel/module.c: Invert add_usage_link and del_usage_link functions
+++ Corentin Labbe [06/06/17 14:17 +0200]:
>This patch just swap del_usage_link() before add_usage_link().
>
>Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>

Could you combine this with the 2nd patch? By itself this patch
doesn't tell us much. Additionally, could you explain in the changelog
(of the 2nd patch) why they needed to be swapped (i.e., so
del_usage_links() can be called from add_usage_links()).

Thanks!

Jessica

> kernel/module.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
>diff --git a/kernel/module.c b/kernel/module.c
>index e3e9dbba6a5b..983b81f6d4ba 100644
>--- a/kernel/module.c
>+++ b/kernel/module.c
>@@ -1663,29 +1663,29 @@ static inline void remove_notes_attrs(struct module *mod)
> }
> #endif /* CONFIG_KALLSYMS */
>
>-static void add_usage_links(struct module *mod)
>+static void del_usage_links(struct module *mod)
> {
> #ifdef CONFIG_MODULE_UNLOAD
> struct module_use *use;
>- int nowarn;
>
> mutex_lock(&module_mutex);
>- list_for_each_entry(use, &mod->target_list, target_list) {
>- nowarn = sysfs_create_link(use->target->holders_dir,
>- &mod->mkobj.kobj, mod->name);
>- }
>+ list_for_each_entry(use, &mod->target_list, target_list)
>+ sysfs_remove_link(use->target->holders_dir, mod->name);
> mutex_unlock(&module_mutex);
> #endif
> }
>
>-static void del_usage_links(struct module *mod)
>+static void add_usage_links(struct module *mod)
> {
> #ifdef CONFIG_MODULE_UNLOAD
> struct module_use *use;
>+ int nowarn;
>
> mutex_lock(&module_mutex);
>- list_for_each_entry(use, &mod->target_list, target_list)
>- sysfs_remove_link(use->target->holders_dir, mod->name);
>+ list_for_each_entry(use, &mod->target_list, target_list) {
>+ nowarn = sysfs_create_link(use->target->holders_dir,
>+ &mod->mkobj.kobj, mod->name);
>+ }
> mutex_unlock(&module_mutex);
> #endif
> }
>--
>2.13.0
>

\
 
 \ /
  Last update: 2017-06-19 18:27    [W:0.075 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site