Files
cubelinux-kernel/drivers/md/dm-vdo/time-utils.h
T
Greg Kroah-Hartman 598cf27219 Linux 6.19.3
Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com>
Tested-by: Peter Schneider <pschneider1968@googlemail.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Tested-by: Brett A C Sheffield <bacs@librecast.net>
Tested-by: Mark Brown <broonie@kernel.org>
Tested-by: Luna Jernberg <droidbittin@gmail.com>
Tested-by: Ronald Warsow <rwarsow@gmx.de>
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Tested-by: Ron Economos <re@w6rz.net>
Tested-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-19 16:33:27 +01:00

29 lines
562 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright 2023 Red Hat
*/
#ifndef UDS_TIME_UTILS_H
#define UDS_TIME_UTILS_H
#include <linux/ktime.h>
#include <linux/time.h>
#include <linux/types.h>
static inline s64 ktime_to_seconds(ktime_t reltime)
{
return reltime / NSEC_PER_SEC;
}
static inline ktime_t current_time_ns(clockid_t clock)
{
return clock == CLOCK_MONOTONIC ? ktime_get_ns() : ktime_get_real_ns();
}
static inline ktime_t current_time_us(void)
{
return current_time_ns(CLOCK_REALTIME) / NSEC_PER_USEC;
}
#endif /* UDS_TIME_UTILS_H */