- struct vtimespec {
- long tv_sec; /* seconds */
+ struct coda_timespec {
+ int64_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
long va_fileid; /* file id */
u_quad_t va_size; /* file size in bytes */
long va_blocksize; /* blocksize preferred for i/o */
- struct vtimespec va_atime; /* time of last access */
- struct vtimespec va_mtime; /* time of last modification */
- struct vtimespec va_ctime; /* time file changed */
+ struct coda_timespec va_atime; /* time of last access */
+ struct coda_timespec va_mtime; /* time of last modification */
+ struct coda_timespec va_ctime; /* time file changed */
u_long va_gen; /* generation number of file */
u_long va_flags; /* flags defined for file */
dev_t va_rdev; /* device special file represents */
return coda_flags;
}
-static struct timespec64 coda_to_timespec64(struct vtimespec ts)
+static struct timespec64 coda_to_timespec64(struct coda_timespec ts)
{
- /*
- * We interpret incoming timestamps as 'signed' to match traditional
- * usage and support pre-1970 timestamps, but this breaks in y2038
- * on 32-bit machines.
- */
struct timespec64 ts64 = {
.tv_sec = ts.tv_sec,
.tv_nsec = ts.tv_nsec,
return ts64;
}
-static struct vtimespec timespec64_to_coda(struct timespec64 ts64)
+static struct coda_timespec timespec64_to_coda(struct timespec64 ts64)
{
- /* clamp the timestamps to the maximum range rather than wrapping */
- struct vtimespec ts = {
- .tv_sec = lower_32_bits(clamp_t(time64_t, ts64.tv_sec,
- LONG_MIN, LONG_MAX)),
+ struct coda_timespec ts = {
+ .tv_sec = ts64.tv_sec,
.tv_nsec = ts64.tv_nsec,
};
vattr->va_uid = (vuid_t) -1;
vattr->va_gid = (vgid_t) -1;
vattr->va_size = (off_t) -1;
- vattr->va_atime.tv_sec = (long) -1;
+ vattr->va_atime.tv_sec = (int64_t) -1;
vattr->va_atime.tv_nsec = (long) -1;
- vattr->va_mtime.tv_sec = (long) -1;
+ vattr->va_mtime.tv_sec = (int64_t) -1;
vattr->va_mtime.tv_nsec = (long) -1;
- vattr->va_ctime.tv_sec = (long) -1;
+ vattr->va_ctime.tv_sec = (int64_t) -1;
vattr->va_ctime.tv_nsec = (long) -1;
vattr->va_type = C_VNON;
vattr->va_fileid = -1;
#define inline
-struct timespec {
- long ts_sec;
- long ts_nsec;
-};
#else /* DJGPP but not KERNEL */
#include <sys/time.h>
typedef unsigned long long u_quad_t;
#define cdev_t dev_t
#endif
-#ifdef __CYGWIN32__
-struct timespec {
- time_t tv_sec; /* seconds */
- long tv_nsec; /* nanoseconds */
-};
-#endif
-
#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
typedef signed char int8_t;
*/
enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
-#ifdef __linux__
-/*
- * This matches the traditional Linux 'timespec' structure binary layout,
- * before using 64-bit time_t everywhere. Overflows in y2038 on 32-bit
- * architectures.
- */
-struct vtimespec {
- long tv_sec; /* seconds */
+struct coda_timespec {
+ int64_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
-#else
-#define vtimespec timespec
-#endif
struct coda_vattr {
long va_type; /* vnode type (for create) */
long va_fileid; /* file id */
u_quad_t va_size; /* file size in bytes */
long va_blocksize; /* blocksize preferred for i/o */
- struct vtimespec va_atime; /* time of last access */
- struct vtimespec va_mtime; /* time of last modification */
- struct vtimespec va_ctime; /* time file changed */
+ struct coda_timespec va_atime; /* time of last access */
+ struct coda_timespec va_mtime; /* time of last modification */
+ struct coda_timespec va_ctime; /* time file changed */
u_long va_gen; /* generation number of file */
u_long va_flags; /* flags defined for file */
cdev_t va_rdev; /* device special file represents */
#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
-#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
+// CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
+#define CODA_KERNEL_VERSION 4 /* 64-bit timespec */
/*
* Venus <-> Coda RPC arguments