All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] libkmod: Prefer builtin index over builtin.alias
@ 2022-02-11  8:42 Lucas De Marchi
  2022-02-11  8:42 ` [PATCH 2/3] depmod: Do not duplicate builtin index Lucas De Marchi
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Lucas De Marchi @ 2022-02-11  8:42 UTC (permalink / raw)
  To: linux-modules; +Cc: gladkov.alexey

The modules.builtin.alias.bin is way larger than the
modules.builtin.bin.  On a normal "distro kernel":

	21k modules.builtin.alias.bin
	11k modules.builtin.bin

From the kernel we get both modules.builtin and modules.builtin.modinfo.
depmod generates modules.builtin.bin and modules.builtin.alias.bin
from them respectively. modules.bultin is not going away: it's not
deprecated by the new index added. So, let's just stop duplicating the
information inside modules.builtin.alias.bin and just use the other
index.
---
 libkmod/libkmod-module.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index 6f7747c..40d394a 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -576,13 +576,14 @@ KMOD_EXPORT int kmod_module_new_from_lookup(struct kmod_ctx *ctx,
 	err = kmod_lookup_alias_from_aliases_file(ctx, alias, list);
 	CHECK_ERR_AND_FINISH(err, fail, list, finish);
 
+	DBG(ctx, "lookup modules.builtin %s\n", alias);
+	err = kmod_lookup_alias_from_builtin_file(ctx, alias, list);
+
 	DBG(ctx, "lookup modules.builtin.modinfo %s\n", alias);
 	err = kmod_lookup_alias_from_kernel_builtin_file(ctx, alias, list);
-	if (err == -ENOSYS) {
-		/* Optional index missing, try the old one */
-		DBG(ctx, "lookup modules.builtin %s\n", alias);
-		err = kmod_lookup_alias_from_builtin_file(ctx, alias, list);
-	}
+	/* Optional index missing, ignore */
+	if (err == -ENOSYS)
+		err = 0;
 	CHECK_ERR_AND_FINISH(err, fail, list, finish);
 
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-02-19 18:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-11  8:42 [PATCH 1/3] libkmod: Prefer builtin index over builtin.alias Lucas De Marchi
2022-02-11  8:42 ` [PATCH 2/3] depmod: Do not duplicate builtin index Lucas De Marchi
2022-02-11  8:42 ` [PATCH 3/3] depmod: Stop opening modules.modinfo once per module Lucas De Marchi
2022-02-11 10:45 ` [PATCH 1/3] libkmod: Prefer builtin index over builtin.alias Alexey Gladkov
2022-02-12  6:04   ` Lucas De Marchi
2022-02-13  7:43     ` [PATCH v2] " Lucas De Marchi
2022-02-13 13:13       ` Alexey Gladkov
2022-02-15  7:43         ` Lucas De Marchi
2022-02-19 12:40           ` Alexey Gladkov
2022-02-19 18:41             ` Lucas De Marchi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.