summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-02-05 10:50:15 -0800
committerKent Overstreet <kent.overstreet@linux.dev>2024-02-27 13:59:03 -0500
commite41ffbbd8817f96af544308151c3c1aeebe3481b (patch)
tree000afd251bca3c5c13ed2c561151d68ff8a3eb18
parent5ec439ea0e7d5cd28c55320911f8610328e21a34 (diff)
time_stats: add larger units
Filesystems can stay mounted for a very long time, so add some larger units. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--lib/time_stats.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/time_stats.c b/lib/time_stats.c
index 767b1a340e80..43106bda43a9 100644
--- a/lib/time_stats.c
+++ b/lib/time_stats.c
@@ -16,6 +16,9 @@ static const struct time_unit time_units[] = {
{ "s", NSEC_PER_SEC },
{ "m", (u64) NSEC_PER_SEC * 60},
{ "h", (u64) NSEC_PER_SEC * 3600},
+ { "d", (u64) NSEC_PER_SEC * 3600 * 24},
+ { "w", (u64) NSEC_PER_SEC * 3600 * 24 * 7},
+ { "y", (u64) NSEC_PER_SEC * ((3600 * 24 * 7 * 365) + (3600 * (24 / 4) * 7))}, /* 365.25d */
{ "eon", U64_MAX },
};