tk->tkr_raw.base = ns_to_ktime(tk->raw_sec * NSEC_PER_SEC);
}
+/*
+ * Restore the shadow timekeeper from the real timekeeper.
+ */
+static void timekeeping_restore_shadow(struct tk_data *tkd)
+{
+ lockdep_assert_held(&tkd->lock);
+ memcpy(&tkd->shadow_timekeeper, &tkd->timekeeper, sizeof(tkd->timekeeper));
+}
+
static void timekeeping_update(struct tk_data *tkd, struct timekeeper *tk, unsigned int action)
{
lockdep_assert_held(&tkd->lock);
* timekeeper structure on the next update with stale data
*/
if (action & TK_MIRROR)
- memcpy(&tkd->shadow_timekeeper, tk, sizeof(*tk));
+ timekeeping_restore_shadow(tkd);
}
static void timekeeping_update_from_shadow(struct tk_data *tkd, unsigned int action)