]> git.ipfire.org Git - thirdparty/kmod.git/commit
lib/module: check initstate before inserting module
authorDave Reisner <dreisner@archlinux.org>
Thu, 2 Feb 2012 16:07:33 +0000 (11:07 -0500)
committerDave Reisner <dreisner@archlinux.org>
Fri, 3 Feb 2012 14:10:13 +0000 (09:10 -0500)
commitaf9572c6d7288515623d2b85204cb97eb5c7b151
treec3b168f204deaa1b01c367634e746d2a30301602
parent7bede7b6a8a75841a09478e59efbc39677b8d1d2
lib/module: check initstate before inserting module

This applies to both the high level probe_insert_module() and the
underlying insert_module() functions. By checking module initstate prior
to inserting a module, we can avoid a lot of needless work just to find
out that the init_module call fails with EEXIST.

This implements a helper function, module_is_inkernel, to return a
boolean value describing if a module is live, coming, or builtin.
libkmod/libkmod-module.c