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
86 86
87#define inline87#define inline
88 88
89struct timespec {
90 long ts_sec;
91 long ts_nsec;
92};
93#else /* DJGPP but not KERNEL */89#else /* DJGPP but not KERNEL */
94#include <sys/time.h>90#include <sys/time.h>
95typedef unsigned long long u_quad_t;91typedef unsigned long long u_quad_t;
@@ -110,13 +106,6 @@ typedef unsigned long long u_quad_t; · 14 unmodified lines
110#define cdev_t dev_t106#define cdev_t dev_t
111#endif107#endif
112 108
113#ifdef __CYGWIN32__
114struct timespec {
115 time_t tv_sec; /* seconds */
116 long tv_nsec; /* nanoseconds */
117};
118#endif
119
120#ifndef __BIT_TYPES_DEFINED__109#ifndef __BIT_TYPES_DEFINED__
121#define __BIT_TYPES_DEFINED__110#define __BIT_TYPES_DEFINED__
122typedef signed char int8_t;111typedef signed char int8_t;
@@ -211,19 +200,10 @@ struct CodaFid { · 88 unmodified lines
211 */200 */
212enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };201enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
213 202
214#ifdef __linux__203struct coda_timespec {
215/*204 int64_t tv_sec; /* seconds */
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 */
220struct vtimespec {
221 long tv_sec; /* seconds */
222 long tv_nsec; /* nanoseconds */205 long tv_nsec; /* nanoseconds */
223};206};
224#else
225#define vtimespec timespec
226#endif
227 207
228struct coda_vattr {208struct coda_vattr {
229 long va_type; /* vnode type (for create) */209 long va_type; /* vnode type (for create) */
@@ -234,9 +214,9 @@ struct coda_vattr { · 4 unmodified lines
234 long va_fileid; /* file id */214 long va_fileid; /* file id */
235 u_quad_t va_size; /* file size in bytes */215 u_quad_t va_size; /* file size in bytes */
236 long va_blocksize; /* blocksize preferred for i/o */216 long va_blocksize; /* blocksize preferred for i/o */
237 struct vtimespec va_atime; /* time of last access */217 struct coda_timespec va_atime; /* time of last access */
238 struct vtimespec va_mtime; /* time of last modification */218 struct coda_timespec va_mtime; /* time of last modification */
239 struct vtimespec va_ctime; /* time file changed */219 struct coda_timespec va_ctime; /* time file changed */
240 u_long va_gen; /* generation number of file */220 u_long va_gen; /* generation number of file */
241 u_long va_flags; /* flags defined for file */221 u_long va_flags; /* flags defined for file */
242 cdev_t va_rdev; /* device special file represents */222 cdev_t va_rdev; /* device special file represents */
@@ -301,7 +281,8 @@ struct coda_statfs { · 58 unmodified lines
301 281
302#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)282#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
303 283
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 */
305 286
306/*287/*
307 * Venus <-> Coda RPC arguments288 * Venus <-> Coda RPC arguments