]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mount: drop UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT and UNIT_DEPENDENCY_MOUNTINFO_DEFAULT
authorFranck Bui <fbui@suse.com>
Mon, 12 Sep 2022 15:50:51 +0000 (17:50 +0200)
committerFranck Bui <fbui@suse.com>
Wed, 5 Oct 2022 09:24:17 +0000 (11:24 +0200)
They're not used anymore.

src/core/mount.c
src/core/unit-serialize.c
src/core/unit.h

index f971519dc6cb3051773e670165662000f437c92d..f9c5c80e35ceb1044fc740ecf3bf35af00c39e36 100644 (file)
@@ -611,11 +611,10 @@ static int mount_add_non_exec_dependencies(Mount *m) {
 
         assert(m);
 
-        /* Any dependencies based on /proc/self/mountinfo may be now stale. */
-        unit_remove_dependencies(UNIT(m),
-                                 UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT |
-                                 UNIT_DEPENDENCY_MOUNTINFO_DEFAULT |
-                                 UNIT_DEPENDENCY_MOUNTINFO_OR_FILE);
+        /* We may be called due to this mount appearing in /proc/self/mountinfo, hence we clear all existing
+         * dependencies that were initialized from the unit file but whose final value really depends on the
+         * content of /proc/self/mountinfo. Some (such as m->where) might have become stale now. */
+        unit_remove_dependencies(UNIT(m), UNIT_DEPENDENCY_MOUNTINFO_OR_FILE);
 
         if (!m->where)
                 return 0;
index 797bf6c5ce92248e2c66b850ee89605431a197fa..a8fb40555008e47b245af5c8cbcbc4f3d3edf40c 100644 (file)
@@ -590,8 +590,6 @@ static void print_unit_dependency_mask(FILE *f, const char *kind, UnitDependency
                 { UNIT_DEPENDENCY_DEFAULT,            "default"            },
                 { UNIT_DEPENDENCY_UDEV,               "udev"               },
                 { UNIT_DEPENDENCY_PATH,               "path"               },
-                { UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT, "mountinfo-implicit" },
-                { UNIT_DEPENDENCY_MOUNTINFO_DEFAULT,  "mountinfo-default"  },
                 { UNIT_DEPENDENCY_MOUNTINFO_OR_FILE,  "mountinfo-or-file"  },
                 { UNIT_DEPENDENCY_PROC_SWAP,          "proc-swap"          },
                 { UNIT_DEPENDENCY_SLICE_PROPERTY,     "slice-property"     },
index 01cef89525e8f30f03d7e717d83ac313c99f9568..06ec7ea7b58945977a04b6a6f826466d8bccaf73 100644 (file)
@@ -79,24 +79,17 @@ typedef enum UnitDependencyMask {
         /* A dependency created because of some unit's RequiresMountsFor= setting */
         UNIT_DEPENDENCY_PATH               = 1 << 4,
 
-        /* A dependency created because of data read from /proc/self/mountinfo and no other configuration source */
-        UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT = 1 << 5,
-
-        /* A dependency created because of data read from /proc/self/mountinfo, but conditionalized by
-         * DefaultDependencies= and thus also involving configuration from UNIT_DEPENDENCY_FILE sources */
-        UNIT_DEPENDENCY_MOUNTINFO_DEFAULT  = 1 << 6,
-
         /* A dependency created because of data read from /proc/self/mountinfo, but fallback to unit configuration
          * sources */
-        UNIT_DEPENDENCY_MOUNTINFO_OR_FILE  = 1 << 7,
+        UNIT_DEPENDENCY_MOUNTINFO_OR_FILE  = 1 << 5,
 
         /* A dependency created because of data read from /proc/swaps and no other configuration source */
-        UNIT_DEPENDENCY_PROC_SWAP          = 1 << 8,
+        UNIT_DEPENDENCY_PROC_SWAP          = 1 << 6,
 
         /* A dependency for units in slices assigned by directly setting Slice= */
-        UNIT_DEPENDENCY_SLICE_PROPERTY     = 1 << 9,
+        UNIT_DEPENDENCY_SLICE_PROPERTY     = 1 << 7,
 
-        _UNIT_DEPENDENCY_MASK_FULL         = (1 << 10) - 1,
+        _UNIT_DEPENDENCY_MASK_FULL         = (1 << 8) - 1,
 } UnitDependencyMask;
 
 /* The Unit's dependencies[] hashmaps use this structure as value. It has the same size as a void pointer, and thus can