From: Ronen Friedman Date: Thu, 17 Aug 2023 14:20:33 +0000 (-0500) Subject: common: add a utime_t::max constant X-Git-Tag: v19.0.0~642^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=403a073c5527da26e472b6e230db6e7cf2dea8e8;p=ceph.git common: add a utime_t::max constant a convenient init value when searching for some early timepoint. Signed-off-by: Ronen Friedman --- diff --git a/src/include/utime.h b/src/include/utime.h index ff8df7e5508f2..588280a7df12b 100644 --- a/src/include/utime.h +++ b/src/include/utime.h @@ -63,6 +63,10 @@ public: } } + static inline constexpr utime_t max() { + return utime_t{time_t{std::numeric_limits::max()}, 999'999'999ul}; + } + // cons constexpr utime_t() { tv.tv_sec = 0; tv.tv_nsec = 0; } constexpr utime_t(time_t s, int n) { tv.tv_sec = s; tv.tv_nsec = n; normalize(); }