swap: hook up with handoff timestamps

This commit is contained in:
Lennart Poettering 2024-04-24 10:13:55 +02:00
parent 19ae89869e
commit 2b5321817f

View file

@ -1422,6 +1422,22 @@ static void swap_reset_failed(Unit *u) {
s->clean_result = SWAP_SUCCESS;
}
static void swap_handoff_timestamp(
Unit *u,
const struct ucred *ucred,
const dual_timestamp *ts) {
Swap *s = ASSERT_PTR(SWAP(u));
assert(ucred);
assert(ts);
if (s->control_pid.pid == ucred->pid && s->control_command) {
exec_status_handoff(&s->control_command->exec_status, ucred, ts);
unit_add_to_dbus_queue(u);
}
}
static int swap_get_timeout(Unit *u, usec_t *timeout) {
Swap *s = ASSERT_PTR(SWAP(u));
usec_t t;
@ -1608,6 +1624,8 @@ const UnitVTable swap_vtable = {
.reset_failed = swap_reset_failed,
.notify_handoff_timestamp = swap_handoff_timestamp,
.control_pid = swap_control_pid,
.bus_set_property = bus_swap_set_property,