.. | .. |
---|
86 | 86 | |
---|
87 | 87 | #define inline |
---|
88 | 88 | |
---|
89 | | -struct timespec { |
---|
90 | | - long ts_sec; |
---|
91 | | - long ts_nsec; |
---|
92 | | -}; |
---|
93 | 89 | #else /* DJGPP but not KERNEL */ |
---|
94 | 90 | #include <sys/time.h> |
---|
95 | 91 | typedef unsigned long long u_quad_t; |
---|
.. | .. |
---|
108 | 104 | #endif /* __KERNEL__ */ |
---|
109 | 105 | #else |
---|
110 | 106 | #define cdev_t dev_t |
---|
111 | | -#endif |
---|
112 | | - |
---|
113 | | -#ifdef __CYGWIN32__ |
---|
114 | | -struct timespec { |
---|
115 | | - time_t tv_sec; /* seconds */ |
---|
116 | | - long tv_nsec; /* nanoseconds */ |
---|
117 | | -}; |
---|
118 | 107 | #endif |
---|
119 | 108 | |
---|
120 | 109 | #ifndef __BIT_TYPES_DEFINED__ |
---|
.. | .. |
---|
211 | 200 | */ |
---|
212 | 201 | enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD }; |
---|
213 | 202 | |
---|
| 203 | +struct coda_timespec { |
---|
| 204 | + int64_t tv_sec; /* seconds */ |
---|
| 205 | + long tv_nsec; /* nanoseconds */ |
---|
| 206 | +}; |
---|
| 207 | + |
---|
214 | 208 | struct coda_vattr { |
---|
215 | 209 | long va_type; /* vnode type (for create) */ |
---|
216 | 210 | u_short va_mode; /* files access mode and type */ |
---|
.. | .. |
---|
220 | 214 | long va_fileid; /* file id */ |
---|
221 | 215 | u_quad_t va_size; /* file size in bytes */ |
---|
222 | 216 | long va_blocksize; /* blocksize preferred for i/o */ |
---|
223 | | - struct timespec va_atime; /* time of last access */ |
---|
224 | | - struct timespec va_mtime; /* time of last modification */ |
---|
225 | | - struct timespec 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 */ |
---|
226 | 220 | u_long va_gen; /* generation number of file */ |
---|
227 | 221 | u_long va_flags; /* flags defined for file */ |
---|
228 | 222 | cdev_t va_rdev; /* device special file represents */ |
---|
.. | .. |
---|
277 | 271 | #define CODA_STATFS 34 |
---|
278 | 272 | #define CODA_STORE 35 |
---|
279 | 273 | #define CODA_RELEASE 36 |
---|
280 | | -#define CODA_NCALLS 37 |
---|
| 274 | +#define CODA_ACCESS_INTENT 37 |
---|
| 275 | +#define CODA_NCALLS 38 |
---|
281 | 276 | |
---|
282 | 277 | #define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID) |
---|
283 | 278 | |
---|
.. | .. |
---|
287 | 282 | |
---|
288 | 283 | #define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t) |
---|
289 | 284 | |
---|
290 | | -#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */ |
---|
| 285 | +// CODA_KERNEL_VERSION 0 /* don't care about kernel version number */ |
---|
| 286 | +// CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */ |
---|
| 287 | +// CODA_KERNEL_VERSION 2 /* venus_lookup gets an extra parameter */ |
---|
| 288 | +// CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */ |
---|
| 289 | +// CODA_KERNEL_VERSION 4 /* 64-bit timespec */ |
---|
| 290 | +#define CODA_KERNEL_VERSION 5 /* access intent support */ |
---|
291 | 291 | |
---|
292 | 292 | /* |
---|
293 | 293 | * Venus <-> Coda RPC arguments |
---|
.. | .. |
---|
295 | 295 | struct coda_in_hdr { |
---|
296 | 296 | u_int32_t opcode; |
---|
297 | 297 | u_int32_t unique; /* Keep multiple outstanding msgs distinct */ |
---|
298 | | - pid_t pid; |
---|
299 | | - pid_t pgid; |
---|
| 298 | + __kernel_pid_t pid; |
---|
| 299 | + __kernel_pid_t pgid; |
---|
300 | 300 | vuid_t uid; |
---|
301 | 301 | }; |
---|
302 | 302 | |
---|
.. | .. |
---|
642 | 642 | struct coda_statfs stat; |
---|
643 | 643 | }; |
---|
644 | 644 | |
---|
| 645 | +#define CODA_ACCESS_TYPE_READ 1 |
---|
| 646 | +#define CODA_ACCESS_TYPE_WRITE 2 |
---|
| 647 | +#define CODA_ACCESS_TYPE_MMAP 3 |
---|
| 648 | +#define CODA_ACCESS_TYPE_READ_FINISH 4 |
---|
| 649 | +#define CODA_ACCESS_TYPE_WRITE_FINISH 5 |
---|
| 650 | + |
---|
| 651 | +/* coda_access_intent: NO_OUT */ |
---|
| 652 | +struct coda_access_intent_in { |
---|
| 653 | + struct coda_in_hdr ih; |
---|
| 654 | + struct CodaFid VFid; |
---|
| 655 | + int count; |
---|
| 656 | + int pos; |
---|
| 657 | + int type; |
---|
| 658 | +}; |
---|
| 659 | + |
---|
| 660 | +struct coda_access_intent_out { |
---|
| 661 | + struct coda_out_hdr out; |
---|
| 662 | +}; |
---|
| 663 | + |
---|
645 | 664 | /* |
---|
646 | 665 | * Occasionally, we don't cache the fid returned by CODA_LOOKUP. |
---|
647 | 666 | * For instance, if the fid is inconsistent. |
---|
.. | .. |
---|
673 | 692 | struct coda_open_by_fd_in coda_open_by_fd; |
---|
674 | 693 | struct coda_open_by_path_in coda_open_by_path; |
---|
675 | 694 | struct coda_statfs_in coda_statfs; |
---|
| 695 | + struct coda_access_intent_in coda_access_intent; |
---|
676 | 696 | }; |
---|
677 | 697 | |
---|
678 | 698 | union outputArgs { |
---|