All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: rusty@rustcorp.com.au
Cc: lkml@vger.kernel.org, linux-kbuild@vger.kernel.org,
	linux-modules@vger.org,
	Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Subject: [PATCH 3/4] module: unexport each_symbol()
Date: Tue, 22 Sep 2009 14:28:31 +0100	[thread overview]
Message-ID: <1253626112-18429-4-git-send-email-alan-jenkins@tuffmail.co.uk> (raw)
In-Reply-To: <1253626112-18429-1-git-send-email-alan-jenkins@tuffmail.co.uk>

find_symbol() is about to be re-written to avoid traversing every single
exported symbol.  each_symbol() has acquired no other in-tree user, so
let us remove it.

Also struct symsearch is useless outside of module.c, so move it there
instead of cluttering up module.h.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
---
 include/linux/module.h |   15 ---------------
 kernel/module.c        |   14 ++++++++++++--
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index 65b62e9..df25f99 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -348,17 +348,6 @@ static inline int within_module_init(unsigned long addr, struct module *mod)
 /* Search for module by name: must hold module_mutex. */
 struct module *find_module(const char *name);
 
-struct symsearch {
-	const struct kernel_symbol *start, *stop;
-	const unsigned long *crcs;
-	enum {
-		NOT_GPL_ONLY,
-		GPL_ONLY,
-		WILL_BE_GPL_ONLY,
-	} licence;
-	bool unused;
-};
-
 /* Search for an exported symbol by name. */
 const struct kernel_symbol *find_symbol(const char *name,
 					struct module **owner,
@@ -366,10 +355,6 @@ const struct kernel_symbol *find_symbol(const char *name,
 					bool gplok,
 					bool warn);
 
-/* Walk the exported symbol table */
-bool each_symbol(bool (*fn)(const struct symsearch *arr, struct module *owner,
-			    unsigned int symnum, void *data), void *data);
-
 /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if
    symnum out of range. */
 int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
diff --git a/kernel/module.c b/kernel/module.c
index 2d53718..b24fc55 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -186,6 +186,17 @@ extern const unsigned long __start___kcrctab_unused[];
 extern const unsigned long __start___kcrctab_unused_gpl[];
 #endif
 
+struct symsearch {
+	const struct kernel_symbol *start, *stop;
+	const unsigned long *crcs;
+	enum {
+		NOT_GPL_ONLY,
+		GPL_ONLY,
+		WILL_BE_GPL_ONLY,
+	} licence;
+	bool unused;
+};
+
 #ifndef CONFIG_MODVERSIONS
 #define symversion(base, idx) NULL
 #else
@@ -212,7 +223,7 @@ static bool each_symbol_in_section(const struct symsearch *arr,
 }
 
 /* Returns true as soon as fn returns true, otherwise false. */
-bool each_symbol(bool (*fn)(const struct symsearch *arr, struct module *owner,
+static bool each_symbol(bool (*fn)(const struct symsearch *arr, struct module *owner,
 			    unsigned int symnum, void *data), void *data)
 {
 	struct module *mod;
@@ -266,7 +277,6 @@ bool each_symbol(bool (*fn)(const struct symsearch *arr, struct module *owner,
 	}
 	return false;
 }
-EXPORT_SYMBOL_GPL(each_symbol);
 
 struct find_symbol_arg {
 	/* Input */
-- 
1.6.3.2


  parent reply	other threads:[~2009-09-22 13:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-22 13:28 module: Speed up symbol resolution during module loading Alan Jenkins
2009-09-22 13:28 ` [PATCH 1/4] module: extract __ExPORT_SYMBOL from module.h into mod_export.h Alan Jenkins
2009-09-22 13:28 ` [PATCH 2/4] kbuild: sort the list of symbols exported by the kernel (__ksymtab) Alan Jenkins
2009-09-22 13:30   ` Alan Jenkins
2009-09-22 13:28 ` Alan Jenkins [this message]
2009-09-22 13:28 ` [PATCH 4/4] module: speed up find_symbol() using binary search on the builtin symbol tables Alan Jenkins
2009-09-23  0:32 ` module: Speed up symbol resolution during module loading Rusty Russell
2009-09-23 16:52   ` Alan Jenkins
2009-09-24  0:08     ` Rusty Russell
2009-09-22 13:38 Alan Jenkins
2009-09-22 13:38 ` [PATCH 3/4] module: unexport each_symbol() Alan Jenkins
2009-09-23 17:29   ` Tim Abbott
2009-09-23 18:36     ` Alan Jenkins
2009-09-23 22:00     ` Christoph Hellwig
2009-09-24  0:15       ` Rusty Russell
2009-09-26 12:13       ` Alan Jenkins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1253626112-18429-4-git-send-email-alan-jenkins@tuffmail.co.uk \
    --to=alan-jenkins@tuffmail.co.uk \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-modules@vger.org \
    --cc=lkml@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.