]> git.ipfire.org Git - thirdparty/kmod.git/log
thirdparty/kmod.git
12 years agointroduce kmod_list_foreach_reverse().
Gustavo Sverzut Barbieri [Sat, 17 Dec 2011 00:33:08 +0000 (22:33 -0200)] 
introduce kmod_list_foreach_reverse().

walks the list in the reverse order.

12 years agoUse tab instead of spaces
Lucas De Marchi [Sat, 17 Dec 2011 22:03:13 +0000 (20:03 -0200)] 
Use tab instead of spaces

12 years agointroduce kmod_list_last()
Gustavo Sverzut Barbieri [Sat, 17 Dec 2011 00:32:33 +0000 (22:32 -0200)] 
introduce kmod_list_last()

This gets the last element in the list, that is, the previous element
of the head.

12 years agofix kmod_list_prev().
Gustavo Sverzut Barbieri [Sat, 17 Dec 2011 00:27:02 +0000 (22:27 -0200)] 
fix kmod_list_prev().

kmod_list_prev() should return NULL if the current element is the
head, not if the previous element is the head. This was likely a copy
& paste error from kmod_list_next().

12 years agoimplement softdeps.
Gustavo Sverzut Barbieri [Fri, 16 Dec 2011 23:18:10 +0000 (21:18 -0200)] 
implement softdeps.

12 years agofix error handling path.
Gustavo Sverzut Barbieri [Fri, 16 Dec 2011 18:17:50 +0000 (16:17 -0200)] 
fix error handling path.

12 years agoimplement zlib module loading.
Gustavo Sverzut Barbieri [Fri, 16 Dec 2011 18:08:53 +0000 (16:08 -0200)] 
implement zlib module loading.

12 years agoLookup for commands in kmod_module_new_from_lookup()
Lucas De Marchi [Fri, 16 Dec 2011 05:57:12 +0000 (03:57 -0200)] 
Lookup for commands in kmod_module_new_from_lookup()

Install and remove commands are now properly treated on lookup. Example
config file:

$ ./test/test-lookup installme
libkmod version 1
Alias: 'installme'
Modules matching:
installme
install commands: 'echo "this is a install message"'

$ ./test/test-lookup removeme
libkmod version 1
Alias: 'removeme'
Modules matching:
removeme
remove commands: 'echo "this is a remove message"'

12 years agokmod_module: do not find more than the first command
Lucas De Marchi [Fri, 16 Dec 2011 05:33:26 +0000 (03:33 -0200)] 
kmod_module: do not find more than the first command

modprobe from module-init-tools does not use more than one
install/remove command, it just stops on the first one. Test
modprobe.conf:

install bla echo "this is a message"
install bla echo "this is a message"

$ modprobe bla
this is a message
$

Install and remove commands are already a legacy thing we need to carry,
but let's not extend it so people do not start doing crazy things.

With this patch we are breaking on the first element we find in the
configuration. May be we can add a warning later when parsing the config
that install commands are duplicated.

12 years agoOpen more file descriptors with O_CLOEXEC
Cristian Rodríguez [Fri, 16 Dec 2011 17:46:52 +0000 (14:46 -0300)] 
Open more file descriptors with O_CLOEXEC

12 years agoLibrary must use O_CLOEXEC whenever it opens file descriptors
Cristian Rodríguez [Fri, 16 Dec 2011 05:49:54 +0000 (02:49 -0300)] 
Library must use O_CLOEXEC whenever it opens file descriptors

12 years agoAdd address of mailing list
Lucas De Marchi [Fri, 16 Dec 2011 06:11:25 +0000 (04:11 -0200)] 
Add address of mailing list

12 years agotools: fix kmod-modprobe -R trying to insert module
Lucas De Marchi [Fri, 16 Dec 2011 04:58:48 +0000 (02:58 -0200)] 
tools: fix kmod-modprobe -R trying to insert module

12 years agoTODO: add new tasks and notes to future development
Lucas De Marchi [Fri, 16 Dec 2011 04:02:58 +0000 (02:02 -0200)] 
TODO: add new tasks and notes to future development

12 years agotrivial: fix typo causing an infinite loop
Ulisses Furquim [Thu, 15 Dec 2011 21:17:49 +0000 (19:17 -0200)] 
trivial: fix typo causing an infinite loop

12 years agokmod 1 v1
Lucas De Marchi [Thu, 15 Dec 2011 17:43:58 +0000 (15:43 -0200)] 
kmod 1

12 years agoAdd libkmod files to EXTRA_DIST
Lucas De Marchi [Thu, 15 Dec 2011 17:37:41 +0000 (15:37 -0200)] 
Add libkmod files to EXTRA_DIST

12 years agoRemove module from hash when it's gone
Lucas De Marchi [Thu, 15 Dec 2011 15:43:22 +0000 (13:43 -0200)] 
Remove module from hash when it's gone

Module was never being removed from hash table. Therefore, if we create
a module, unref it and create it again we will access freed memory.
Commit "53385cf Improve test of double references" introduced a new test
in test-mod-double-ref.c that previously to this commit was crashing and
now it's working fine.

12 years agoImprove test of double references
Lucas De Marchi [Thu, 15 Dec 2011 15:42:54 +0000 (13:42 -0200)] 
Improve test of double references

12 years agoAdd safety NULL checks in exported functions
Lucas De Marchi [Thu, 15 Dec 2011 15:35:40 +0000 (13:35 -0200)] 
Add safety NULL checks in exported functions

12 years agoFix changing hash key after module is inserted in hash
Lucas De Marchi [Thu, 15 Dec 2011 15:11:51 +0000 (13:11 -0200)] 
Fix changing hash key after module is inserted in hash

The hash key is not copied so we can't change the string from:
modname/modalias

to:

modname'\0'modalias

in order to setup mod->name and mod->alias.

Now what we do is:

1) if name is in the form 'modname/modalias', the final struct
   kmod_module will be:

   struct kmod_module {
           char *alias;------,
           char *name;-----, |
           char *hashkey;--|-|-,
   }                       | | |
   name <------------------' | |
   alias <-------------------' |
   hashkey <-------------------'

2) if name is in the simple form 'modname', then the final struct
   kmod_module will be:

   struct kmod_module {
           char *alias;------> NULL
           char *name;-----,
           char *hashkey;--|---,
   }                       |   |
   name <------------------*---'

12 years agoFix docs with wrong function names
Lucas De Marchi [Thu, 15 Dec 2011 15:09:46 +0000 (13:09 -0200)] 
Fix docs with wrong function names

12 years agoAdd comment in public header about flags not implemented
Lucas De Marchi [Thu, 15 Dec 2011 14:27:45 +0000 (12:27 -0200)] 
Add comment in public header about flags not implemented

12 years agoRename symbol group
Lucas De Marchi [Thu, 15 Dec 2011 14:26:15 +0000 (12:26 -0200)] 
Rename symbol group

12 years agoRemove flags that likely will not be used
Lucas De Marchi [Thu, 15 Dec 2011 14:15:31 +0000 (12:15 -0200)] 
Remove flags that likely will not be used

12 years agoTODO: rephrase some tasks
Lucas De Marchi [Thu, 15 Dec 2011 14:14:43 +0000 (12:14 -0200)] 
TODO: rephrase some tasks

12 years agoAdd file with details regarding coding style
Lucas De Marchi [Thu, 15 Dec 2011 02:43:54 +0000 (00:43 -0200)] 
Add file with details regarding coding style

12 years agoFix format of log message
Lucas De Marchi [Wed, 14 Dec 2011 19:21:46 +0000 (17:21 -0200)] 
Fix format of log message

12 years agokmod_config: parse kernel command line for options and blacklist
Lucas De Marchi [Wed, 14 Dec 2011 19:19:19 +0000 (17:19 -0200)] 
kmod_config: parse kernel command line for options and blacklist

12 years agoDo not depend on AM_SILENT_RULES if it is not available.
Luis Felipe Strano Moraes [Wed, 14 Dec 2011 17:56:10 +0000 (15:56 -0200)] 
Do not depend on AM_SILENT_RULES if it is not available.

12 years agokmod_module: use 'modname/aliasname' as key for hash
Lucas De Marchi [Wed, 14 Dec 2011 17:21:10 +0000 (15:21 -0200)] 
kmod_module: use 'modname/aliasname' as key for hash

1 alias may correspond to more than 1 module. This would cause a
conflict in the hash table when inserting a module there and bad things
could happen.

Now we use 'modname/aliasname' as key, '/aliasname' part being optional.
Internally kmod_module_new_from_alias() will setup a 'modname/aliasname'
string and pass to kmod_module_new_from_name() that will treat the case
with a '/' in the name.

User might call kmod_module_new_from_name() without any slashes, so the
key my not contain it.

12 years agoUse malloc + memset instead of calloc
Lucas De Marchi [Wed, 14 Dec 2011 17:05:03 +0000 (15:05 -0200)] 
Use malloc + memset instead of calloc

12 years agoTODO: update tasks
Lucas De Marchi [Wed, 14 Dec 2011 16:02:28 +0000 (14:02 -0200)] 
TODO: update tasks

12 years agokmod_module: move function to the right section
Lucas De Marchi [Wed, 14 Dec 2011 14:10:02 +0000 (12:10 -0200)] 
kmod_module: move function to the right section

12 years agokmod_module: fix log message upon module removal
Lucas De Marchi [Wed, 14 Dec 2011 14:07:37 +0000 (12:07 -0200)] 
kmod_module: fix log message upon module removal

12 years agokmod_module: add missing documentation
Lucas De Marchi [Wed, 14 Dec 2011 14:06:18 +0000 (12:06 -0200)] 
kmod_module: add missing documentation

12 years agoSimplify kmod_load_resources()
Lucas De Marchi [Wed, 14 Dec 2011 05:58:31 +0000 (03:58 -0200)] 
Simplify kmod_load_resources()

We have a static vector of indexes. There's no need to check if they
have a suffix or if they are absolute, we just already know in advance
and there are no plans to change it.

12 years agoLog and break early if index is already open
Lucas De Marchi [Wed, 14 Dec 2011 05:53:43 +0000 (03:53 -0200)] 
Log and break early if index is already open

12 years agoUpdate documentation
Lucas De Marchi [Wed, 14 Dec 2011 05:44:38 +0000 (03:44 -0200)] 
Update documentation

12 years agoRemove function kmod_resolve_alias_options()
Lucas De Marchi [Tue, 13 Dec 2011 16:25:29 +0000 (14:25 -0200)] 
Remove function kmod_resolve_alias_options()

Remove function kmod_resolve_alias_options since it's not needed
anymore. Test is using the following configuration file:

alias blablabla ac
options ac test=1
options blablabla test=2

Lookup test by module name:
$ ./test/test-lookup ac
libkmod version 1
Alias: 'ac'
Modules matching:
ac
options: 'test=1'

Lookup test by alias:
$ ./test/test-lookup blablabla
libkmod version 1
Alias: 'blablabla'
Modules matching:
ac
options: 'test=1 test=2'

12 years agokmod_module: make get_options() search for alias names too
Lucas De Marchi [Tue, 13 Dec 2011 16:21:24 +0000 (14:21 -0200)] 
kmod_module: make get_options() search for alias names too

12 years agoCreate module by alias name where appropriate
Lucas De Marchi [Tue, 13 Dec 2011 16:20:48 +0000 (14:20 -0200)] 
Create module by alias name where appropriate

12 years agoAdd private function kmod_module_new_from_alias()
Lucas De Marchi [Tue, 13 Dec 2011 16:12:50 +0000 (14:12 -0200)] 
Add private function kmod_module_new_from_alias()

This function will create a new kmod_module() by calling
kmod_module_new_from_name(), but instead of given the module name, it
gives the alias. This way, the modules' hash will contain the alias
instead of the name. If module was created successfully, then it swap
the alias with the actual name.

The downside is that the structure is not shared anymore if we create a
kmod_module by alias and after by name. However, in modprobe's
configuration it's possible to have different options for different
aliases. In future we might want to create a way to share the common
part of the structure (then having only one instance as we had before).

12 years agokmod_module: use pointer instead of vector for its name
Lucas De Marchi [Tue, 13 Dec 2011 15:07:40 +0000 (13:07 -0200)] 
kmod_module: use pointer instead of vector for its name

We still have name allocated just after the struct kmod_module, but
now we use a pointer instead of putting name as a vector in the end of
the structure.

The previous way has some problems, the worst is:
- it's not possible to swap the name with another value: this is
  the real problem that this patch is solving. Later patches
  will make name be swappable with alias, which is not possible
  if name is a vector.

12 years agoReturn early on lookup error
Lucas De Marchi [Tue, 13 Dec 2011 12:48:49 +0000 (10:48 -0200)] 
Return early on lookup error

There's no reason to keep looking for options if alias didn't match.

12 years agoUse alias_normalize() instead of modname_normalize()
Lucas De Marchi [Tue, 13 Dec 2011 12:28:00 +0000 (10:28 -0200)] 
Use alias_normalize() instead of modname_normalize()

When normalizing alias names (or if we don't know if it's an alias or
modname), use alias_normalize() instead of modname_normalize(). The
difference is that alias names can contain dashes withing brackets, and
those should not be changed to underscores.

Most of the places using underscores() function might be converted to
alias_normalize(), but this is not done now.

12 years agoAdd helper alias_normalize()
Lucas De Marchi [Tue, 13 Dec 2011 12:24:22 +0000 (10:24 -0200)] 
Add helper alias_normalize()

12 years agoFix check for NULL variable
Lucas De Marchi [Tue, 13 Dec 2011 12:26:04 +0000 (10:26 -0200)] 
Fix check for NULL variable

12 years agoFix "Dereference of null pointer" as reported by llvm
Lucas De Marchi [Mon, 12 Dec 2011 20:41:57 +0000 (18:41 -0200)] 
Fix "Dereference of null pointer" as reported by llvm

12 years agoFix "Dead assignments" as reported by llvm
Lucas De Marchi [Mon, 12 Dec 2011 20:36:27 +0000 (18:36 -0200)] 
Fix "Dead assignments" as reported by llvm

12 years agohandle case where modname was not detected.
Gustavo Sverzut Barbieri [Mon, 12 Dec 2011 20:28:52 +0000 (18:28 -0200)] 
handle case where modname was not detected.

12 years agoChange licenses
Lucas De Marchi [Mon, 12 Dec 2011 20:24:35 +0000 (18:24 -0200)] 
Change licenses

libkmod is under LGPL 2.1 or later
tools/* are under GPL

12 years agobuild-sys: enable debug by default in autogen.sh
Lucas De Marchi [Mon, 12 Dec 2011 19:26:47 +0000 (17:26 -0200)] 
build-sys: enable debug by default in autogen.sh

12 years agobuild-sys: Set CFLAGS to "-O2 -Werror" in autogen.sh
Lucas De Marchi [Mon, 12 Dec 2011 19:23:19 +0000 (17:23 -0200)] 
build-sys: Set CFLAGS to "-O2 -Werror" in autogen.sh

12 years agoRemove warnings: ‘err’ may be used uninitialized in this function
Lucas De Marchi [Mon, 12 Dec 2011 19:23:04 +0000 (17:23 -0200)] 
Remove warnings: ‘err’ may be used uninitialized in this function

12 years agobuild-sys: add version map file to build dependencies
Lucas De Marchi [Mon, 12 Dec 2011 19:05:23 +0000 (17:05 -0200)] 
build-sys: add version map file to build dependencies

Based on original patch from Jan Engelhardt <jengelh@medozas.de> to
libabc.

12 years agoRename project from libkmod to kmod
Lucas De Marchi [Mon, 12 Dec 2011 18:41:38 +0000 (16:41 -0200)] 
Rename project from libkmod to kmod

12 years agoDo not use config if it's not needed/wanted
Lucas De Marchi [Mon, 12 Dec 2011 17:41:02 +0000 (15:41 -0200)] 
Do not use config if it's not needed/wanted

12 years agoUse true/false for bool return
Lucas De Marchi [Mon, 12 Dec 2011 17:27:57 +0000 (15:27 -0200)] 
Use true/false for bool return

12 years agoDirectories inside config directories are not supported
Lucas De Marchi [Mon, 12 Dec 2011 17:23:03 +0000 (15:23 -0200)] 
Directories inside config directories are not supported

This was failing silent, both in libkmod and module-init-tools. Give a
warning if we created a dir inside config directories.

12 years agoDo not stat() dir twice
Lucas De Marchi [Mon, 12 Dec 2011 17:00:51 +0000 (15:00 -0200)] 
Do not stat() dir twice

12 years agoFix leak of DIR
Lucas De Marchi [Mon, 12 Dec 2011 16:26:45 +0000 (14:26 -0200)] 
Fix leak of DIR

12 years agoRemove leftover comment
Lucas De Marchi [Mon, 12 Dec 2011 16:01:25 +0000 (14:01 -0200)] 
Remove leftover comment

mod->path is always absolute: remove comment from previous behavior.

12 years agoRemove libkmod-loaded.c and re-order functions in libkmod-module.c
Lucas De Marchi [Mon, 12 Dec 2011 15:56:47 +0000 (13:56 -0200)] 
Remove libkmod-loaded.c and re-order functions in libkmod-module.c

It's not possible to move functions related to "live" modules to
libkmod-loaded.c because they depend on the definition of kmod_module.
Putting this structure in the private header is not a good idea, so let
all functions related to "live" information in the end of
libkmod-module.c, and move the sole function from libkmod-loaded.c to
this place. This way all functions get the right documentation
about their sections.

12 years agoRename kmod_loaded_get_list() to kmod_module_new_from_loaded()
Lucas De Marchi [Mon, 12 Dec 2011 15:49:27 +0000 (13:49 -0200)] 
Rename kmod_loaded_get_list() to kmod_module_new_from_loaded()

Be consistent with other similar functions already present and improve
documentation.

12 years agobuild-sys: replace spaces with tabs
Lucas De Marchi [Mon, 12 Dec 2011 15:39:07 +0000 (13:39 -0200)] 
build-sys: replace spaces with tabs

12 years agobuild-sys: move remaining warning flags to configure
Lucas De Marchi [Mon, 12 Dec 2011 15:37:13 +0000 (13:37 -0200)] 
build-sys: move remaining warning flags to configure

12 years agobuild-sys: remove duplicated warning flags
Lucas De Marchi [Mon, 12 Dec 2011 15:26:34 +0000 (13:26 -0200)] 
build-sys: remove duplicated warning flags

"822ce23 beef compile flags" added warning flags to configure, but some
of them were already present in autogen.sh. Remove the flags from
autogen.sh.

12 years agocoding style: be consistent with blank lines
Lucas De Marchi [Mon, 12 Dec 2011 13:52:59 +0000 (11:52 -0200)] 
coding style: be consistent with blank lines

12 years agocoding style: fix lines over 80 chars
Lucas De Marchi [Mon, 12 Dec 2011 12:48:02 +0000 (10:48 -0200)] 
coding style: fix lines over 80 chars

Lines should not go over 80 chars with a few exceptions:
- headers
- function definitions with only 1 argument
- long strings, otherwise we break grep

This should go later in a coding-style file

12 years agoMerge branch 'use-mmap'
Lucas De Marchi [Mon, 12 Dec 2011 12:30:01 +0000 (10:30 -0200)] 
Merge branch 'use-mmap'

Conflicts:
libkmod/libkmod.c

12 years agoAPI-BREAK: kmod_new() takes a second parameter for configuration directory.
Gustavo Sverzut Barbieri [Sun, 11 Dec 2011 22:37:01 +0000 (20:37 -0200)] 
API-BREAK: kmod_new() takes a second parameter for configuration directory.

This is required by modprobe and also to help doing unit tests in future.

12 years agotools: add modprobe
Gustavo Sverzut Barbieri [Sun, 11 Dec 2011 21:36:18 +0000 (19:36 -0200)] 
tools: add modprobe

try to mimic original module-init-tools' modprobe as much as possible,
but this exposed some missing features in libkmod, these are now
listed in TODO.

12 years agoadd lsmod, insmod and rmmod tools.
Gustavo Sverzut Barbieri [Sun, 11 Dec 2011 00:19:41 +0000 (22:19 -0200)] 
add lsmod, insmod and rmmod tools.

these tools are compatible with module-init-tools (except insmod does
not take data from stdin).

12 years agoadd missing newline to log messages.
Gustavo Sverzut Barbieri [Sun, 11 Dec 2011 21:42:02 +0000 (19:42 -0200)] 
add missing newline to log messages.

12 years agobe less verbose on initstate for unexistent modules.
Gustavo Sverzut Barbieri [Sun, 11 Dec 2011 21:33:03 +0000 (19:33 -0200)] 
be less verbose on initstate for unexistent modules.

the module may be unloaded, in this case -NOENT is returned but it
should not present an error message

12 years agobeef compile flags.
Gustavo Sverzut Barbieri [Sun, 11 Dec 2011 00:26:40 +0000 (22:26 -0200)] 
beef compile flags.

Beef the compile flags by using the same set recommended by systemd,
it uses attribute.m4 from the xine project to check supported flags.

12 years agoinsmod: allows providing option to module.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 23:02:39 +0000 (21:02 -0200)] 
insmod: allows providing option to module.

12 years agoalways normalize user-given alias.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 23:00:19 +0000 (21:00 -0200)] 
always normalize user-given alias.

12 years agoexport module's options and commands.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 22:47:01 +0000 (20:47 -0200)] 
export module's options and commands.

This will be required to implement modprobe later. The implementation
follows "man modprobe.conf" and allows options to be specified for
alias as well, thus the need for kmod_resolve_alias_options().

Example mod-a.conf:

    options mod-a a=1 b=2
    options mod-a c=3
    alias mymod-a mod-a
    options mymod-a d=4

Results in:
    options mod-a a=1 b=2 c=3
    options mymod-a a=1 b=2 c=3 d=4

Install commands are being concatenated with ";", but manpage is not
clean about this behavior.

12 years agoparse_depline may be called from libkmod.c
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 22:36:22 +0000 (20:36 -0200)] 
parse_depline may be called from libkmod.c

allow parse_depline to be called when already initialized as it may be
called from libkmod.c and at that point there is no way to check
mod->init.dep

12 years agofix string replace.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 21:45:37 +0000 (19:45 -0200)] 
fix string replace.

configure files with this would fail:

options wl x=1

were being handled as " =1".

12 years agokmod: Add documentation and format comments
Lucas De Marchi [Fri, 9 Dec 2011 18:42:14 +0000 (16:42 -0200)] 
kmod: Add documentation and format comments

12 years agoupdate TODO
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 15:32:27 +0000 (13:32 -0200)] 
update TODO

12 years agoindex: fix memleak for non-matchin aliases.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 15:28:18 +0000 (13:28 -0200)] 
index: fix memleak for non-matchin aliases.

12 years agoindex-mm: allocate values inline into node, strings points to mmap.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 15:04:43 +0000 (13:04 -0200)] 
index-mm: allocate values inline into node, strings points to mmap.

For mmap mode, we can avoid allocating and copying strings from the
mmap'ed memory.

With that we have fixed length "struct index_mm_value" that can be
allocated inline with "struct index_mm_node".

12 years agoindex: cleanup header, move as much as possible to libkmod-index.c
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 13:53:51 +0000 (11:53 -0200)] 
index: cleanup header, move as much as possible to libkmod-index.c

12 years agoindex-mm: no need to allocate prefix.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 13:44:31 +0000 (11:44 -0200)] 
index-mm: no need to allocate prefix.

12 years agoindex-mm: fix memory access.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 13:36:35 +0000 (11:36 -0200)] 
index-mm: fix memory access.

uint32_t reads must be aligned, they're not then use memcpy().

read_alloc_chars_mm() and read_chars_mm() were wrong, normalize all
address calculation using single byte pointer "addr" that is
incremented by the amount read, this will avoid further errors.

12 years agotest-lookup: allow loading resources for testing.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 12:28:11 +0000 (10:28 -0200)] 
test-lookup: allow loading resources for testing.

12 years agokmod_load_resources: use proper full path to binary files to be mmaped.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 12:27:27 +0000 (10:27 -0200)] 
kmod_load_resources: use proper full path to binary files to be mmaped.

12 years agokmod_lookup_alias_from_alias_bin: debug message for mmap case.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 11:28:42 +0000 (09:28 -0200)] 
kmod_lookup_alias_from_alias_bin: debug message for mmap case.

12 years agokmod_search_moddep: reorder to avoid creating path when not required.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 11:26:27 +0000 (09:26 -0200)] 
kmod_search_moddep: reorder to avoid creating path when not required.

if we're using mmap'ed index, say so and avoid creating the path as it
won't be used.

12 years agofix snprintf usage.
Gustavo Sverzut Barbieri [Sat, 10 Dec 2011 11:21:03 +0000 (09:21 -0200)] 
fix snprintf usage.

snprintf() takes the full buffer size, including \0 and guarantees it
will be there.

12 years agokmod: Add documentation and format comments
Lucas De Marchi [Fri, 9 Dec 2011 18:42:14 +0000 (16:42 -0200)] 
kmod: Add documentation and format comments

12 years agoUse alias/symbol index_mm if it's open
Lucas De Marchi [Fri, 9 Dec 2011 18:11:42 +0000 (16:11 -0200)] 
Use alias/symbol index_mm if it's open

12 years agoPass enum around instead of filename
Lucas De Marchi [Fri, 9 Dec 2011 18:06:04 +0000 (16:06 -0200)] 
Pass enum around instead of filename

This will allow us to later use the index to search these indexes.

12 years agoUse index_mm if it's open for moddep search
Lucas De Marchi [Fri, 9 Dec 2011 17:47:23 +0000 (15:47 -0200)] 
Use index_mm if it's open for moddep search

12 years agoDo not allocate path for known places an close resource asap
Lucas De Marchi [Fri, 9 Dec 2011 17:33:37 +0000 (15:33 -0200)] 
Do not allocate path for known places an close resource asap

This place is not supposed to exceed PATH_MAX. So, use snprintf instead
of asprintf.

Close the index before iterating the values.

12 years agoLoad and unload resources
Lucas De Marchi [Thu, 8 Dec 2011 16:59:51 +0000 (14:59 -0200)] 
Load and unload resources

This call will mmap all the index files and in future some of the work
done in ctx creation can be put here.