Skip to content

Commit cdbfa22

Browse files
Darrick J. WongKent Overstreet
authored andcommitted
bcachefs: 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>
1 parent f1ca1ab commit cdbfa22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/bcachefs/time_stats.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ static const struct time_unit time_units[] = {
1717
{ "s", NSEC_PER_SEC },
1818
{ "m", (u64) NSEC_PER_SEC * 60},
1919
{ "h", (u64) NSEC_PER_SEC * 3600},
20+
{ "d", (u64) NSEC_PER_SEC * 3600 * 24},
21+
{ "w", (u64) NSEC_PER_SEC * 3600 * 24 * 7},
22+
{ "y", (u64) NSEC_PER_SEC * ((3600 * 24 * 7 * 365) + (3600 * (24 / 4) * 7))}, /* 365.25d */
2023
{ "eon", U64_MAX },
2124
};
2225

0 commit comments

Comments
 (0)