goto end;
}
}
+
+ if (!rc)
+ rc = mnt_context_call_hooks(cxt, MNT_STAGE_PREP);
+
if (rc) {
DBG(CXT, ul_debugobj(cxt, "mount: preparing failed"));
goto end;
assert(hs == &hookset_mount_legacy);
#ifdef UL_HAVE_MOUNT_API
- /* do nothing when __builtin-mount succesfully registred */
+ /* do nothing when __mount succesfully registred */
if (mnt_context_has_hook(cxt, &hookset_mount, 0, NULL))
return 0;
#endif
{
.name = "__legacy-mount",
- .firststage = MNT_STAGE_PREP_OPTIONS,
+ .firststage = MNT_STAGE_PREP,
.firstcall = hook_prepare,
.deinit = hookset_deinit
[MNT_STAGE_PREP_SOURCE] = "prep-source",
[MNT_STAGE_PREP_TARGET] = "prep-target",
[MNT_STAGE_PREP_OPTIONS] = "prep-options",
+ [MNT_STAGE_PREP] = "prep",
+
/* mount */
[MNT_STAGE_MOUNT_PRE] = "pre-mount",
[MNT_STAGE_MOUNT] = "mount",
[MNT_STAGE_MOUNT_POST] = "post-mount",
+
/* post */
[MNT_STAGE_POST] = "post",
};
* stuff like veritydev.c.
*/
enum {
- MNT_STAGE_PREP_SOURCE = 1,
- MNT_STAGE_PREP_TARGET,
- MNT_STAGE_PREP_OPTIONS,
+ MNT_STAGE_PREP_SOURCE = 1, /* mount source preparation */
+ MNT_STAGE_PREP_TARGET, /* mount target preparation */
+ MNT_STAGE_PREP_OPTIONS, /* mount options preparation */
+ MNT_STAGE_PREP, /* all prepared */
- MNT_STAGE_MOUNT_PRE = 100,
- MNT_STAGE_MOUNT,
- MNT_STAGE_MOUNT_POST,
+ MNT_STAGE_MOUNT_PRE = 100, /* before mount */
+ MNT_STAGE_MOUNT, /* mount(2) or fsmount(2) or tree-clone */
+ MNT_STAGE_MOUNT_POST, /* after mount */
- MNT_STAGE_POST = 200
+ MNT_STAGE_POST = 200 /* all is done */
};
struct libmnt_hookset {