[Concept,01/34] ext4l: Move timespec64 and time64_t to linux/time.h

Message ID 20260114225635.3407989-2-sjg@u-boot.org
State New
Headers
Series ext4l: Clean up ext4_uboot.h by moving definitions to standard headers |

Commit Message

Simon Glass Jan. 14, 2026, 10:55 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Move the timespec64 structure and time64_t typedef from ext4_uboot.h to
include/linux/time.h where they logically belong. This reduces
duplication and aligns with Linux kernel header organisation.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/ext4l/ext4_uboot.h | 11 +++--------
 include/linux/time.h  |  8 ++++++++
 2 files changed, 11 insertions(+), 8 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index 4a7e41a75a1..b2a33a17198 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -38,6 +38,7 @@ 
 #include <linux/iomap.h>
 #include <linux/seq_file.h>
 #include <linux/rbtree.h>	/* Real rbtree implementation */
+#include <linux/time.h>		/* For timespec64, time64_t */
 #include <u-boot/crc.h>		/* For crc32() used by crc32_be */
 
 /*
@@ -70,11 +71,7 @@  static inline u32 rol32(u32 word, unsigned int shift)
 	return (word << (shift & 31)) | (word >> ((-shift) & 31));
 }
 
-/* Time types */
-struct timespec64 {
-	time_t tv_sec;
-	long tv_nsec;
-};
+/* Time types - timespec64 and time64_t are now in linux/time.h */
 
 /*
  * ktime_t, sector_t are now in linux/types.h
@@ -544,9 +541,7 @@  struct fscrypt_dummy_policy {
 };
 
 /* errseq_t is defined in linux/fs.h */
-
-/* time64_t */
-typedef s64 time64_t;
+/* time64_t is now in linux/time.h */
 
 /* IS_NOQUOTA - stub */
 #define IS_NOQUOTA(inode)	(0)
diff --git a/include/linux/time.h b/include/linux/time.h
index 0de44cff8d7..b23598295c2 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -166,4 +166,12 @@  time64_t mktime64(const unsigned int year, const unsigned int mon,
 		  const unsigned int min, const unsigned int sec);
 #endif
 
+/* 64-bit time representation with nanoseconds */
+typedef s64 time64_t;
+
+struct timespec64 {
+	time_t tv_sec;
+	long tv_nsec;
+};
+
 #endif