|
 |
0bf83d |
From c0e580154e1469f1bcef132b1a7585409f66e1e5 Mon Sep 17 00:00:00 2001
|
|
 |
0bf83d |
From: "Darrick J. Wong" <darrick.wong@oracle.com>
|
|
 |
0bf83d |
Date: Tue, 10 Nov 2020 14:52:31 -0500
|
|
 |
0bf83d |
Subject: [PATCH] libxfs: refactor NSEC_PER_SEC
|
|
 |
0bf83d |
|
|
 |
0bf83d |
Clean up all the open-coded and duplicate definitions of time unit
|
|
 |
0bf83d |
conversion factors.
|
|
 |
0bf83d |
|
|
 |
0bf83d |
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
 |
0bf83d |
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
|
|
 |
0bf83d |
Reviewed-by: Christoph Hellwig <hch@lst.de>
|
|
 |
0bf83d |
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
|
|
 |
0bf83d |
---
|
|
 |
0bf83d |
|
|
 |
0bf83d |
NOTE: scrub is not present in rhel8, so that hunk is omitted
|
|
 |
0bf83d |
|
|
 |
0bf83d |
diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in
|
|
 |
0bf83d |
index d111ec6..0b7214e 100644
|
|
 |
0bf83d |
--- a/include/platform_defs.h.in
|
|
 |
0bf83d |
+++ b/include/platform_defs.h.in
|
|
 |
0bf83d |
@@ -77,4 +77,7 @@ typedef unsigned short umode_t;
|
|
 |
0bf83d |
# define ASSERT(EX) ((void) 0)
|
|
 |
0bf83d |
#endif
|
|
 |
0bf83d |
|
|
 |
0bf83d |
+#define NSEC_PER_SEC (1000000000ULL)
|
|
 |
0bf83d |
+#define NSEC_PER_USEC (1000ULL)
|
|
 |
0bf83d |
+
|
|
 |
0bf83d |
#endif /* __XFS_PLATFORM_DEFS_H__ */
|
|
 |
0bf83d |
diff --git a/repair/dinode.c b/repair/dinode.c
|
|
 |
0bf83d |
index 77f78f1..8fa5f88 100644
|
|
 |
0bf83d |
--- a/repair/dinode.c
|
|
 |
0bf83d |
+++ b/repair/dinode.c
|
|
 |
0bf83d |
@@ -2216,7 +2216,7 @@ check_nsec(
|
|
 |
0bf83d |
struct xfs_timestamp *t,
|
|
 |
0bf83d |
int *dirty)
|
|
 |
0bf83d |
{
|
|
 |
0bf83d |
- if (be32_to_cpu(t->t_nsec) < 1000000000)
|
|
 |
0bf83d |
+ if (be32_to_cpu(t->t_nsec) < NSEC_PER_SEC)
|
|
 |
0bf83d |
return;
|
|
 |
0bf83d |
|
|
 |
0bf83d |
do_warn(
|
|
 |
0bf83d |
diff --git a/scrub/progress.c b/scrub/progress.c
|
|
 |
0bf83d |
index d0afe90..2058f59 100644
|
|
 |
0bf83d |
--- a/scrub/progress.c
|
|
 |
0bf83d |
+++ b/scrub/progress.c
|
|
 |
0bf83d |
@@ -110,7 +110,6 @@ progress_report(
|
|
 |
0bf83d |
fflush(pt.fp);
|
|
 |
0bf83d |
}
|
|
 |
0bf83d |
|
|
 |
0bf83d |
-#define NSEC_PER_SEC (1000000000)
|
|
 |
0bf83d |
static void *
|
|
 |
0bf83d |
progress_report_thread(void *arg)
|
|
 |
0bf83d |
{
|