summaryrefslogtreecommitdiff
path: root/libkmod/libkmod-module.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-01-18 01:26:44 -0200
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2012-01-30 13:52:22 -0200
commitece09aac7f516549c6f14b7af68cd9c24d709b68 (patch)
tree0e5521b0b6a3fcae1ce780819c48e12da50784d3 /libkmod/libkmod-module.c
parentd48b8a792dc4140223e65f43542ddd9703efd322 (diff)
downloadkmod-ece09aac7f516549c6f14b7af68cd9c24d709b68.tar.gz
kmod-ece09aac7f516549c6f14b7af68cd9c24d709b68.tar.bz2
kmod-ece09aac7f516549c6f14b7af68cd9c24d709b68.zip
libkmod-module: add visited field
This field can be used to iterate the modules, controlling whether we are revisiting a certain module. A function to clear the values in all modules is needed since when we are iterating, we don't know if the module is created anew or if it's picked from the pool. Therefore we can't know if the field is true because of a previous iteration or if the module was indeed already visited.
Diffstat (limited to 'libkmod/libkmod-module.c')
-rw-r--r--libkmod/libkmod-module.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index 983deef..e4adcc6 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -68,6 +68,7 @@ struct kmod_module {
bool install_commands : 1;
bool remove_commands : 1;
} init;
+ bool visited : 1;
};
static inline const char *path_join(const char *path, size_t prefixlen,
@@ -163,6 +164,11 @@ fail:
return err;
}
+void kmod_module_set_visited(struct kmod_module *mod, bool visited)
+{
+ mod->visited = visited;
+}
+
/**
* kmod_module_new_from_name:
* @ctx: kmod library context