]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: cleanup comments for hooks
authorKarel Zak <kzak@redhat.com>
Thu, 8 Sep 2022 11:08:15 +0000 (13:08 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Jan 2023 11:58:42 +0000 (12:58 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/hook_idmap.c
libmount/src/hook_loopdev.c
libmount/src/hook_mkdir.c
libmount/src/hook_mount_legacy.c
libmount/src/hook_owner.c
libmount/src/hook_subdir.c
libmount/src/hook_veritydev.c
libmount/src/hooks.c

index 29f34700ccb057e4c3f1ac3c80257744e5dd8772..1718679457f2ca74da75ca1c6e45b1cf084f3b94 100644 (file)
@@ -12,6 +12,8 @@
  *
  *
  * This is X-mount.idmap= implementation.
+ *
+ * Please, see the comment in libmount/src/hooks.c to understand how hooks work.
  */
 #include <stdbool.h>
 #include <sys/socket.h>
index 652ae76377b11fd1956644d9c6dcc67881b3fa1a..22379cf72d34a740ec91330565c724f44159cf13 100644 (file)
@@ -8,12 +8,9 @@
  * under the terms of the GNU Lesser General Public License as published by
  * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
+ *
+ * Please, see the comment in libmount/src/hooks.c to understand how hooks work.
  */
-
-/*
- * DOCS: - "lo@" prefix for fstype is unsupported
- */
-
 #include <blkid.h>
 #include <stdbool.h>
 
index bd8a083030fffd39267963c10a797004f4e97ee5..6e4d73663885a295d18aa7dc2fd5f0e140a41c6a 100644 (file)
@@ -8,8 +8,10 @@
  * under the terms of the GNU Lesser General Public License as published by
  * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
+ *
+ *
+ * Please, see the comment in libmount/src/hooks.c to understand how hooks work.
  */
-
 #include "mountP.h"
 #include "fileutils.h"
 
index 7468f31f93f771f6cd18d928b1ce5b72f5fd203c..8b082f2abe96c33fd2df8c8e7d8e148ba22607c6 100644 (file)
@@ -8,6 +8,11 @@
  * under the terms of the GNU Lesser General Public License as published by
  * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
+ *
+ *
+ * This is classic mount(2) based mount.
+ *
+ * Please, see the comment in libmount/src/hooks.c to understand how hooks work.
  */
 
 #include "mountP.h"
index 02fdcbefd9e838e8c1902630154f88c2de7df686..9c23733a384f0423e8b25c954b03c66f7bfe957f 100644 (file)
@@ -11,8 +11,9 @@
  *
  *
  * This is X-mount.owner=, X-mount.group= and X-mount.mode= implementation.
+ *
+ * Please, see the comment in libmount/src/hooks.c to understand how hooks work.
  */
-
 #include <sched.h>
 
 #include "mountP.h"
index 34b680b3fac31022bad816f773c85b1992420229..d0a274bc70c252cc95bb41400ab0a17734dc425b 100644 (file)
@@ -12,8 +12,9 @@
  *
  * This is X-mount.subdir= implementation. The code uses global hookset data
  * rather than per-callback (hook) data.
+ *
+ * Please, see the comment in libmount/src/hooks.c to understand how hooks work.
  */
-
 #include <sched.h>
 
 #include "mountP.h"
index 8f2386539cc1c9efa742e9a3bed6c73a7ac02f5f..f91778ad95bcd58ae321cbe0785513a09bca6b13 100644 (file)
@@ -9,8 +9,10 @@
  * under the terms of the GNU Lesser General Public License as published by
  * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
+ *
+ *
+ * Please, see comment in libmount/src/hooks.c to understand how hooks work.
  */
-
 #include "mountP.h"
 
 #ifdef HAVE_CRYPTSETUP
index 4340ac61cac761ba1771223ed41e0825e446c9d1..d0117e4562162134bc4b4b15929c75f567bac326 100644 (file)
  * (at your option) any later version.
  *
  *
- * The "hookset" is set of callbacks (hooks) that implement some functionality.
- * It supports two kinds of data:
+ * The "hookset" is a set of callbacks (hooks) that implement some functionality.
+ * The library defines stages where hooks are called (e.g. when preparing source, post
+ * mount(2), etc.). An arbitrary hook can, on the fly, define another hook for the
+ * arbitrary stage. The first hook from the hookset which goes to the game is a
+ * "firstcall" (defined in struct libmnt_hookset). This first hook controls
+ * what will happen in the next stages (usually nothing).
  *
- *  - global data    : accessible for all callbacks, independent on defined hooks
+ * The library supports two kinds of data for hooksets:
  *
- *  - per-hook data  : usually used by the callback function
+ * - global data;  accessible for all callbacks. Makes sense for complex
+ *   hooksets with more callbacks in more stages. Usually implemented by
+ *   locally defined 'struct hookset_data' in hook_*.c.
+ *
+ * - per-hook data; acessible for specific callback
+ *   Usually implemented by locally defined 'struct hook_data' in hook_*.c.
  */
-
 #include "mountP.h"
 #include "mount-api-utils.h"
 
@@ -39,7 +47,7 @@ static const struct libmnt_hookset *hooksets[] =
 #endif
 };
 
-/* hooksets data */
+/* hooksets data (this is global list of hookset data) */
 struct hookset_data {
        const struct libmnt_hookset *hookset;
        void *data;