History

coda: change Coda's user api to use 64-bit time_t in timespec

Move the 32-bit time_t problems to userspace.

Jan Harkes committed 7 years ago

Commit 5e7c31d1 parent 6ced9aa3 files · +19 −45Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/coda.h+7−26
@@ -86,10 +86,6 @@ typedef unsigned long long u_quad_t; · 85 unmodified lines
8686
8787 #define inline
8888
89−struct timespec {
90− long ts_sec;
91− long ts_nsec;
92−};
9389 #else /* DJGPP but not KERNEL */
9490 #include <sys/time.h>
9591 typedef unsigned long long u_quad_t;
@@ -110,13 +106,6 @@ typedef unsigned long long u_quad_t; · 14 unmodified lines
110106 #define cdev_t dev_t
111107 #endif
112108
113−#ifdef __CYGWIN32__
114−struct timespec {
115− time_t tv_sec; /* seconds */
116− long tv_nsec; /* nanoseconds */
117−};
118−#endif
119−
120109 #ifndef __BIT_TYPES_DEFINED__
121110 #define __BIT_TYPES_DEFINED__
122111 typedef signed char int8_t;
@@ -211,19 +200,10 @@ struct CodaFid { · 88 unmodified lines
211200 */
212201 enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
213202
214−#ifdef __linux__
215−/*
216− * This matches the traditional Linux 'timespec' structure binary layout,
217− * before using 64-bit time_t everywhere. Overflows in y2038 on 32-bit
218− * architectures.
219− */
220−struct vtimespec {
221− long tv_sec; /* seconds */
203+struct coda_timespec {
204+ int64_t tv_sec; /* seconds */
222205 long tv_nsec; /* nanoseconds */
223206 };
224−#else
225−#define vtimespec timespec
226−#endif
227207
228208 struct coda_vattr {
229209 long va_type; /* vnode type (for create) */
@@ -234,9 +214,9 @@ struct coda_vattr { · 4 unmodified lines
234214 long va_fileid; /* file id */
235215 u_quad_t va_size; /* file size in bytes */
236216 long va_blocksize; /* blocksize preferred for i/o */
237− struct vtimespec va_atime; /* time of last access */
238− struct vtimespec va_mtime; /* time of last modification */
239− struct vtimespec va_ctime; /* time file changed */
217+ struct coda_timespec va_atime; /* time of last access */
218+ struct coda_timespec va_mtime; /* time of last modification */
219+ struct coda_timespec va_ctime; /* time file changed */
240220 u_long va_gen; /* generation number of file */
241221 u_long va_flags; /* flags defined for file */
242222 cdev_t va_rdev; /* device special file represents */
@@ -301,7 +281,8 @@ struct coda_statfs { · 58 unmodified lines
301281
302282 #define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
303283
304−#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
284+// CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
285+#define CODA_KERNEL_VERSION 4 /* 64-bit timespec */
305286
306287 /*
307288 * Venus <-> Coda RPC arguments