]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
device: drop refuse_after
authorFranck Bui <fbui@suse.com>
Mon, 30 Mar 2020 08:49:29 +0000 (10:49 +0200)
committerFranck Bui <fbui@suse.com>
Wed, 1 Apr 2020 08:35:14 +0000 (10:35 +0200)
Scheduling devices after a given unit can be useful to start device *jobs* at a
specific time in the transaction, see commit 4195077ab4c823c.

This (hidden) change was introduced by commit eef85c4a3f8054d2.

src/core/device.c
src/core/unit.c
src/core/unit.h

index 06bbbf8d2c3d1f26f5205d917a49040a718abecd..45149e75554c9243b299f93a6ebf8b7d43d2320f 100644 (file)
@@ -1064,7 +1064,6 @@ const UnitVTable device_vtable = {
                 "Device\0"
                 "Install\0",
 
-        .refuse_after = true,
         .gc_jobs = true,
 
         .init = device_init,
index 2816bcef5504e780a3d8f2836cdfbdb917ea816c..115938e6cefd32285ffbd55a234c6558d68706b1 100644 (file)
@@ -2957,13 +2957,10 @@ int unit_add_dependency(
                 return 0;
         }
 
-        if (d == UNIT_AFTER && UNIT_VTABLE(u)->refuse_after) {
-                log_unit_warning(u, "Requested dependency After=%s ignored (%s units cannot be delayed).", other->id, unit_type_to_string(u->type));
-                return 0;
-        }
-
-        if (d == UNIT_BEFORE && UNIT_VTABLE(other)->refuse_after) {
-                log_unit_warning(u, "Requested dependency Before=%s ignored (%s units cannot be delayed).", other->id, unit_type_to_string(other->type));
+        /* Note that ordering a device unit after a unit is permitted since it
+         * allows to start its job running timeout at a specific time. */
+        if (d == UNIT_BEFORE && other->type == UNIT_DEVICE) {
+                log_unit_warning(u, "Dependency Before=%s ignored (.device units cannot be delayed)", other->id);
                 return 0;
         }
 
index 2e103f7ab294d07fa5e5aad9dbccd1ffe9f74bc1..93d6f7092b2804476dae9ece30fd1574246eb6fe 100644 (file)
@@ -610,9 +610,6 @@ typedef struct UnitVTable {
         /* True if the unit type knows a failure state, and thus can be source of an OnFailure= dependency */
         bool can_fail:1;
 
-        /* True if After= dependencies should be refused */
-        bool refuse_after:1;
-
         /* True if units of this type shall be startable only once and then never again */
         bool once_only:1;