core: rename "mount_flags" → "mount_propagation_flag" internally where appropriate

ExecContext has a field that controls the mount propagation flag of the
mounts in the resulting namespace. This is exposed as "MountFlags="
which is super confusing, as it suggests one could control more than
propagation, and that it was actually a flags field. It's an enum
though only, and nothing else.

We might want to rename this externally one day, but given the compat
kludges this requires and the fact this is somewhat nichey it might not
be worth it. But internally let's rename it, as it makes things much
easier to grok, in particular as part of the codebase already exposed
the concept as mount_propagation_flag.

No actual code flow changes, just some renaming.
This commit is contained in:
Lennart Poettering
2023-03-14 13:00:27 +09:00
committed by Yu Watanabe
parent eacfbd89c3
commit 874cdcbcf5
8 changed files with 21 additions and 20 deletions
+3 -3
View File
@@ -2114,7 +2114,7 @@ bool exec_needs_mount_namespace(
if (!strv_isempty(context->extension_directories))
return true;
if (!IN_SET(context->mount_flags, 0, MS_SHARED))
if (!IN_SET(context->mount_propagation_flag, 0, MS_SHARED))
return true;
if (context->private_tmp && runtime && (runtime->tmp_dir || runtime->var_tmp_dir))
@@ -3671,7 +3671,7 @@ static int apply_mount_namespace(
else
ns_info = (NamespaceInfo) {};
if (context->mount_flags == MS_SHARED)
if (context->mount_propagation_flag == MS_SHARED)
log_unit_debug(u, "shared mount propagation hidden by other fs namespacing unit settings: ignoring");
if (exec_context_has_credentials(context) &&
@@ -3726,7 +3726,7 @@ static int apply_mount_namespace(
var_tmp_dir,
creds_path,
context->log_namespace,
context->mount_flags,
context->mount_propagation_flag,
context->root_hash, context->root_hash_size, context->root_hash_path,
context->root_hash_sig, context->root_hash_sig_size, context->root_hash_sig_path,
context->root_verity,