summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-09-12 10:37:40 +0000
committerThierry Vignaud <tv@mageia.org>2012-09-12 10:37:40 +0000
commit54ef68f584de6f12defa217ecc61fcf395ecd7e2 (patch)
tree19a8bd7b24cdf96ff3b5d5e58369aa9e8f4c6a23 /common.h
parent42b81d579dc2f0323c6728e4d12002b1b8ed349b (diff)
downloadldetect-54ef68f584de6f12defa217ecc61fcf395ecd7e2.tar
ldetect-54ef68f584de6f12defa217ecc61fcf395ecd7e2.tar.gz
ldetect-54ef68f584de6f12defa217ecc61fcf395ecd7e2.tar.bz2
ldetect-54ef68f584de6f12defa217ecc61fcf395ecd7e2.tar.xz
ldetect-54ef68f584de6f12defa217ecc61fcf395ecd7e2.zip
make ldetect 3x faster (and even faster on machines quite quite a lot
of devices such as servers) (modalias_init) split it out of modalias_resolve_module() (modalias_cleanup) move libkmod related cleanups here (hid_probe,find_modules_through_aliases) only initialize libkmod once (which reduces user time from 0.26 to 0.08s & elapsed time from 0.28 to 0.9s)
Diffstat (limited to 'common.h')
-rw-r--r--common.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/common.h b/common.h
index e6f927d..cf99de2 100644
--- a/common.h
+++ b/common.h
@@ -19,8 +19,9 @@ typedef enum {
extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable, const descr_lookup, int is_pci) NON_EXPORTED;
extern void pciusb_initialize(struct pciusb_entry *e) NON_EXPORTED;
-extern char *modalias_resolve_module(const char *modalias) NON_EXPORTED;
-extern void modalias_cleanup(void) NON_EXPORTED;
+extern struct kmod_ctx* modalias_init() NON_EXPORTED;
+extern char *modalias_resolve_module(struct kmod_ctx *ctx, const char *modalias) NON_EXPORTED;
+extern void modalias_cleanup(struct kmod_ctx *ctx) NON_EXPORTED;
#define MAX_DEVICES 100
#define BUF_SIZE 512