Blame SOURCES/xfsprogs-5.10.0-libxfs-refactor-NSEC_PER_SEC.patch

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