From: Lennart Poettering Date: Wed, 24 Apr 2024 08:13:55 +0000 (+0200) Subject: swap: hook up with handoff timestamps X-Git-Tag: v256-rc1~14^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b5321817f9062e6021d87573cdf81b503f48351;p=thirdparty%2Fsystemd.git swap: hook up with handoff timestamps --- diff --git a/src/core/swap.c b/src/core/swap.c index 3d202607287..222241c9da2 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -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,