]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
libkmod/docs: document and reference kmod_remove
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 6 Sep 2024 16:43:24 +0000 (11:43 -0500)
Mostly move the existing documentation from kmod_module_remove_module().

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
libkmod/docs/libkmod-sections.txt
libkmod/libkmod.h

index a8f84ca785fe9249321a9238d110c9f0b29bdd9d..ad026aa20d491daf6121d53b8069135879486287 100644 (file)
@@ -62,6 +62,7 @@ kmod_insert
 kmod_module_insert_module
 kmod_probe
 kmod_module_probe_insert_module
+kmod_remove
 kmod_module_remove_module
 
 kmod_module_get_module
index 65a1f30d46db53c9675208e97a151fd5f38f5c2f..f02001d6a20c1d9c81ff8fc74e98b894bebce50b 100644 (file)
@@ -743,24 +743,27 @@ int kmod_module_probe_insert_module(struct kmod_module *mod,
                        void (*print_action)(struct kmod_module *m, bool install,
                                                const char *options));
 
-/* Removal flags */
+/**
+ * kmod_remove:
+ * @KMOD_REMOVE_FORCE: force remove module regardless if it's still in
+ * use by a kernel subsystem or other process; passed directly to the kernel
+ * @KMOD_REMOVE_NOWAIT: always set, pass O_NONBLOCK to delete_module(2);
+ * passed directly to the kernel
+ * @KMOD_REMOVE_NOLOG: when module removal fails, do not log anything; not
+ * passed to the kernel
+ *
+ * Removal flags, used by kmod_module_remove_module().
+ */
 enum kmod_remove {
        KMOD_REMOVE_FORCE = O_TRUNC,
-       KMOD_REMOVE_NOWAIT = O_NONBLOCK, /* always set */
-       /* libkmod-only defines, not passed to kernel */
+       KMOD_REMOVE_NOWAIT = O_NONBLOCK,
        KMOD_REMOVE_NOLOG = 1,
 };
 
 /**
  * kmod_module_remove_module:
  * @mod: kmod module
- * @flags: flags used when removing the module.
- * KMOD_REMOVE_FORCE: force remove module regardless if it's still in
- * use by a kernel subsystem or other process; passed directly to Linux kernel
- * KMOD_REMOVE_NOWAIT: is always enforced, causing us to pass O_NONBLOCK to
- * delete_module(2).
- * KMOD_REMOVE_NOLOG: when module removal fails, do not log anything as the
- * caller may want to handle retries and log when appropriate.
+ * @flags: flags used when removing the module, valid flags are #kmod_remove
  *
  * Remove a module from Linux kernel.
  *