blob: b1e429b499a60e9e558a300dae563942c22d23f2 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI_CODA_HEADER_
8#define _UAPI_CODA_HEADER_
9#if defined(__NetBSD__) || (defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL)
10#include <sys/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011#endif
12#ifndef CODA_MAXSYMLINKS
13#define CODA_MAXSYMLINKS 10
14#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070015#if defined(DJGPP) || defined(__CYGWIN32__)
16#ifdef KERNEL
17typedef unsigned long u_long;
18typedef unsigned int u_int;
Ben Cheng655a7c02013-10-16 16:09:24 -070019typedef unsigned short u_short;
20typedef u_long ino_t;
21typedef u_long dev_t;
22typedef void * caddr_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070023#ifdef DOS
24typedef unsigned __int64 u_quad_t;
25#else
26typedef unsigned long long u_quad_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070027#endif
28#define inline
Ben Cheng655a7c02013-10-16 16:09:24 -070029#else
30#include <sys/time.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070031typedef unsigned long long u_quad_t;
32#endif
33#endif
34#ifdef __linux__
Ben Cheng655a7c02013-10-16 16:09:24 -070035#include <linux/time.h>
36#define cdev_t u_quad_t
37#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
38#define _UQUAD_T_ 1
Ben Cheng655a7c02013-10-16 16:09:24 -070039typedef unsigned long long u_quad_t;
40#endif
41#else
42#define cdev_t dev_t
Ben Cheng655a7c02013-10-16 16:09:24 -070043#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070044#ifndef __BIT_TYPES_DEFINED__
Ben Cheng655a7c02013-10-16 16:09:24 -070045#define __BIT_TYPES_DEFINED__
46typedef signed char int8_t;
47typedef unsigned char u_int8_t;
48typedef short int16_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070049typedef unsigned short u_int16_t;
50typedef int int32_t;
51typedef unsigned int u_int32_t;
52#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070053#define CODA_MAXNAMLEN 255
54#define CODA_MAXPATHLEN 1024
55#define CODA_MAXSYMLINK 10
56#define C_O_READ 0x001
Ben Cheng655a7c02013-10-16 16:09:24 -070057#define C_O_WRITE 0x002
58#define C_O_TRUNC 0x010
59#define C_O_EXCL 0x100
60#define C_O_CREAT 0x200
Ben Cheng655a7c02013-10-16 16:09:24 -070061#define C_M_READ 00400
62#define C_M_WRITE 00200
63#define C_A_C_OK 8
64#define C_A_R_OK 4
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define C_A_W_OK 2
66#define C_A_X_OK 1
67#define C_A_F_OK 0
68#ifndef _VENUS_DIRENT_T_
Ben Cheng655a7c02013-10-16 16:09:24 -070069#define _VENUS_DIRENT_T_ 1
70struct venus_dirent {
Tao Baod7db5942015-01-28 10:07:51 -080071 u_int32_t d_fileno;
72 u_int16_t d_reclen;
Tao Baod7db5942015-01-28 10:07:51 -080073 u_int8_t d_type;
74 u_int8_t d_namlen;
75 char d_name[CODA_MAXNAMLEN + 1];
Ben Cheng655a7c02013-10-16 16:09:24 -070076};
Ben Cheng655a7c02013-10-16 16:09:24 -070077#undef DIRSIZ
Tao Baod7db5942015-01-28 10:07:51 -080078#define DIRSIZ(dp) ((sizeof(struct venus_dirent) - (CODA_MAXNAMLEN + 1)) + (((dp)->d_namlen + 1 + 3) & ~3))
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define CDT_UNKNOWN 0
80#define CDT_FIFO 1
Ben Cheng655a7c02013-10-16 16:09:24 -070081#define CDT_CHR 2
82#define CDT_DIR 4
83#define CDT_BLK 6
84#define CDT_REG 8
Ben Cheng655a7c02013-10-16 16:09:24 -070085#define CDT_LNK 10
86#define CDT_SOCK 12
87#define CDT_WHT 14
88#define IFTOCDT(mode) (((mode) & 0170000) >> 12)
Ben Cheng655a7c02013-10-16 16:09:24 -070089#define CDTTOIF(dirtype) ((dirtype) << 12)
90#endif
91#ifndef _VUID_T_
92#define _VUID_T_
Ben Cheng655a7c02013-10-16 16:09:24 -070093typedef u_int32_t vuid_t;
94typedef u_int32_t vgid_t;
95#endif
96struct CodaFid {
Tao Baod7db5942015-01-28 10:07:51 -080097 u_int32_t opaque[4];
Ben Cheng655a7c02013-10-16 16:09:24 -070098};
Tao Baod7db5942015-01-28 10:07:51 -080099#define coda_f2i(fid) (fid ? (fid->opaque[3] ^ (fid->opaque[2] << 10) ^ (fid->opaque[1] << 20) ^ fid->opaque[0]) : 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700100#ifndef _VENUS_VATTR_T_
Ben Cheng655a7c02013-10-16 16:09:24 -0700101#define _VENUS_VATTR_T_
Tao Baod7db5942015-01-28 10:07:51 -0800102enum coda_vtype {
103 C_VNON,
104 C_VREG,
Tao Baod7db5942015-01-28 10:07:51 -0800105 C_VDIR,
106 C_VBLK,
107 C_VCHR,
108 C_VLNK,
Tao Baod7db5942015-01-28 10:07:51 -0800109 C_VSOCK,
110 C_VFIFO,
111 C_VBAD
Ben Cheng655a7c02013-10-16 16:09:24 -0700112};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700113struct coda_timespec {
114 int64_t tv_sec;
115 long tv_nsec;
116};
Tao Baod7db5942015-01-28 10:07:51 -0800117struct coda_vattr {
118 long va_type;
119 u_short va_mode;
120 short va_nlink;
Tao Baod7db5942015-01-28 10:07:51 -0800121 vuid_t va_uid;
122 vgid_t va_gid;
123 long va_fileid;
124 u_quad_t va_size;
Tao Baod7db5942015-01-28 10:07:51 -0800125 long va_blocksize;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700126 struct coda_timespec va_atime;
127 struct coda_timespec va_mtime;
128 struct coda_timespec va_ctime;
Tao Baod7db5942015-01-28 10:07:51 -0800129 u_long va_gen;
130 u_long va_flags;
131 cdev_t va_rdev;
132 u_quad_t va_bytes;
Tao Baod7db5942015-01-28 10:07:51 -0800133 u_quad_t va_filerev;
134};
Ben Cheng655a7c02013-10-16 16:09:24 -0700135#endif
136struct coda_statfs {
Tao Baod7db5942015-01-28 10:07:51 -0800137 int32_t f_blocks;
138 int32_t f_bfree;
139 int32_t f_bavail;
140 int32_t f_files;
Tao Baod7db5942015-01-28 10:07:51 -0800141 int32_t f_ffree;
Ben Cheng655a7c02013-10-16 16:09:24 -0700142};
Ben Cheng655a7c02013-10-16 16:09:24 -0700143#define CODA_ROOT 2
144#define CODA_OPEN_BY_FD 3
145#define CODA_OPEN 4
146#define CODA_CLOSE 5
Ben Cheng655a7c02013-10-16 16:09:24 -0700147#define CODA_IOCTL 6
148#define CODA_GETATTR 7
149#define CODA_SETATTR 8
150#define CODA_ACCESS 9
Ben Cheng655a7c02013-10-16 16:09:24 -0700151#define CODA_LOOKUP 10
152#define CODA_CREATE 11
153#define CODA_REMOVE 12
154#define CODA_LINK 13
Ben Cheng655a7c02013-10-16 16:09:24 -0700155#define CODA_RENAME 14
156#define CODA_MKDIR 15
157#define CODA_RMDIR 16
158#define CODA_SYMLINK 18
Ben Cheng655a7c02013-10-16 16:09:24 -0700159#define CODA_READLINK 19
160#define CODA_FSYNC 20
161#define CODA_VGET 22
162#define CODA_SIGNAL 23
Ben Cheng655a7c02013-10-16 16:09:24 -0700163#define CODA_REPLACE 24
164#define CODA_FLUSH 25
165#define CODA_PURGEUSER 26
166#define CODA_ZAPFILE 27
Ben Cheng655a7c02013-10-16 16:09:24 -0700167#define CODA_ZAPDIR 28
168#define CODA_PURGEFID 30
169#define CODA_OPEN_BY_PATH 31
170#define CODA_RESOLVE 32
Ben Cheng655a7c02013-10-16 16:09:24 -0700171#define CODA_REINTEGRATE 33
172#define CODA_STATFS 34
173#define CODA_STORE 35
174#define CODA_RELEASE 36
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700175#define CODA_ACCESS_INTENT 37
176#define CODA_NCALLS 38
Ben Cheng655a7c02013-10-16 16:09:24 -0700177#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
Tao Baod7db5942015-01-28 10:07:51 -0800178#define VC_MAXDATASIZE 8192
179#define VC_MAXMSGSIZE sizeof(union inputArgs) + sizeof(union outputArgs) + VC_MAXDATASIZE
Ben Cheng655a7c02013-10-16 16:09:24 -0700180#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700181#define CODA_KERNEL_VERSION 5
Ben Cheng655a7c02013-10-16 16:09:24 -0700182struct coda_in_hdr {
Tao Baod7db5942015-01-28 10:07:51 -0800183 u_int32_t opcode;
184 u_int32_t unique;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700185 __kernel_pid_t pid;
186 __kernel_pid_t pgid;
Tao Baod7db5942015-01-28 10:07:51 -0800187 vuid_t uid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700188};
189struct coda_out_hdr {
Tao Baod7db5942015-01-28 10:07:51 -0800190 u_int32_t opcode;
191 u_int32_t unique;
192 u_int32_t result;
Ben Cheng655a7c02013-10-16 16:09:24 -0700193};
194struct coda_root_out {
Tao Baod7db5942015-01-28 10:07:51 -0800195 struct coda_out_hdr oh;
196 struct CodaFid VFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700197};
Tao Baod7db5942015-01-28 10:07:51 -0800198struct coda_root_in {
199 struct coda_in_hdr in;
Ben Cheng655a7c02013-10-16 16:09:24 -0700200};
201struct coda_open_in {
Tao Baod7db5942015-01-28 10:07:51 -0800202 struct coda_in_hdr ih;
203 struct CodaFid VFid;
204 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700205};
Tao Baod7db5942015-01-28 10:07:51 -0800206struct coda_open_out {
207 struct coda_out_hdr oh;
208 cdev_t dev;
209 ino_t inode;
Ben Cheng655a7c02013-10-16 16:09:24 -0700210};
211struct coda_store_in {
Tao Baod7db5942015-01-28 10:07:51 -0800212 struct coda_in_hdr ih;
213 struct CodaFid VFid;
Tao Baod7db5942015-01-28 10:07:51 -0800214 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700215};
Ben Cheng655a7c02013-10-16 16:09:24 -0700216struct coda_store_out {
Tao Baod7db5942015-01-28 10:07:51 -0800217 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700218};
219struct coda_release_in {
Tao Baod7db5942015-01-28 10:07:51 -0800220 struct coda_in_hdr ih;
221 struct CodaFid VFid;
Tao Baod7db5942015-01-28 10:07:51 -0800222 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700223};
Ben Cheng655a7c02013-10-16 16:09:24 -0700224struct coda_release_out {
Tao Baod7db5942015-01-28 10:07:51 -0800225 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700226};
227struct coda_close_in {
Tao Baod7db5942015-01-28 10:07:51 -0800228 struct coda_in_hdr ih;
229 struct CodaFid VFid;
Tao Baod7db5942015-01-28 10:07:51 -0800230 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700231};
Ben Cheng655a7c02013-10-16 16:09:24 -0700232struct coda_close_out {
Tao Baod7db5942015-01-28 10:07:51 -0800233 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700234};
235struct coda_ioctl_in {
Tao Baod7db5942015-01-28 10:07:51 -0800236 struct coda_in_hdr ih;
237 struct CodaFid VFid;
Tao Baod7db5942015-01-28 10:07:51 -0800238 int cmd;
239 int len;
240 int rwflag;
241 char * data;
Ben Cheng655a7c02013-10-16 16:09:24 -0700242};
243struct coda_ioctl_out {
Tao Baod7db5942015-01-28 10:07:51 -0800244 struct coda_out_hdr oh;
245 int len;
Tao Baod7db5942015-01-28 10:07:51 -0800246 caddr_t data;
Ben Cheng655a7c02013-10-16 16:09:24 -0700247};
Ben Cheng655a7c02013-10-16 16:09:24 -0700248struct coda_getattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800249 struct coda_in_hdr ih;
Tao Baod7db5942015-01-28 10:07:51 -0800250 struct CodaFid VFid;
251};
Ben Cheng655a7c02013-10-16 16:09:24 -0700252struct coda_getattr_out {
Tao Baod7db5942015-01-28 10:07:51 -0800253 struct coda_out_hdr oh;
Tao Baod7db5942015-01-28 10:07:51 -0800254 struct coda_vattr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700255};
Ben Cheng655a7c02013-10-16 16:09:24 -0700256struct coda_setattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800257 struct coda_in_hdr ih;
Tao Baod7db5942015-01-28 10:07:51 -0800258 struct CodaFid VFid;
259 struct coda_vattr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700260};
261struct coda_setattr_out {
Tao Baod7db5942015-01-28 10:07:51 -0800262 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700263};
Ben Cheng655a7c02013-10-16 16:09:24 -0700264struct coda_access_in {
Tao Baod7db5942015-01-28 10:07:51 -0800265 struct coda_in_hdr ih;
Tao Baod7db5942015-01-28 10:07:51 -0800266 struct CodaFid VFid;
267 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700268};
269struct coda_access_out {
Tao Baod7db5942015-01-28 10:07:51 -0800270 struct coda_out_hdr out;
271};
Ben Cheng655a7c02013-10-16 16:09:24 -0700272#define CLU_CASE_SENSITIVE 0x01
273#define CLU_CASE_INSENSITIVE 0x02
274struct coda_lookup_in {
Tao Baod7db5942015-01-28 10:07:51 -0800275 struct coda_in_hdr ih;
276 struct CodaFid VFid;
277 int name;
Tao Baod7db5942015-01-28 10:07:51 -0800278 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700279};
Ben Cheng655a7c02013-10-16 16:09:24 -0700280struct coda_lookup_out {
Tao Baod7db5942015-01-28 10:07:51 -0800281 struct coda_out_hdr oh;
Tao Baod7db5942015-01-28 10:07:51 -0800282 struct CodaFid VFid;
283 int vtype;
Ben Cheng655a7c02013-10-16 16:09:24 -0700284};
285struct coda_create_in {
Tao Baod7db5942015-01-28 10:07:51 -0800286 struct coda_in_hdr ih;
287 struct CodaFid VFid;
288 struct coda_vattr attr;
289 int excl;
Tao Baod7db5942015-01-28 10:07:51 -0800290 int mode;
291 int name;
Ben Cheng655a7c02013-10-16 16:09:24 -0700292};
293struct coda_create_out {
Tao Baod7db5942015-01-28 10:07:51 -0800294 struct coda_out_hdr oh;
295 struct CodaFid VFid;
296 struct coda_vattr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700297};
Tao Baod7db5942015-01-28 10:07:51 -0800298struct coda_remove_in {
299 struct coda_in_hdr ih;
300 struct CodaFid VFid;
301 int name;
Ben Cheng655a7c02013-10-16 16:09:24 -0700302};
303struct coda_remove_out {
Tao Baod7db5942015-01-28 10:07:51 -0800304 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700305};
306struct coda_link_in {
Tao Baod7db5942015-01-28 10:07:51 -0800307 struct coda_in_hdr ih;
308 struct CodaFid sourceFid;
309 struct CodaFid destFid;
Tao Baod7db5942015-01-28 10:07:51 -0800310 int tname;
Ben Cheng655a7c02013-10-16 16:09:24 -0700311};
Ben Cheng655a7c02013-10-16 16:09:24 -0700312struct coda_link_out {
Tao Baod7db5942015-01-28 10:07:51 -0800313 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700314};
315struct coda_rename_in {
Tao Baod7db5942015-01-28 10:07:51 -0800316 struct coda_in_hdr ih;
317 struct CodaFid sourceFid;
Tao Baod7db5942015-01-28 10:07:51 -0800318 int srcname;
319 struct CodaFid destFid;
320 int destname;
Ben Cheng655a7c02013-10-16 16:09:24 -0700321};
Tao Baod7db5942015-01-28 10:07:51 -0800322struct coda_rename_out {
323 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700324};
325struct coda_mkdir_in {
Tao Baod7db5942015-01-28 10:07:51 -0800326 struct coda_in_hdr ih;
327 struct CodaFid VFid;
328 struct coda_vattr attr;
329 int name;
Ben Cheng655a7c02013-10-16 16:09:24 -0700330};
331struct coda_mkdir_out {
Tao Baod7db5942015-01-28 10:07:51 -0800332 struct coda_out_hdr oh;
333 struct CodaFid VFid;
Tao Baod7db5942015-01-28 10:07:51 -0800334 struct coda_vattr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700335};
Ben Cheng655a7c02013-10-16 16:09:24 -0700336struct coda_rmdir_in {
Tao Baod7db5942015-01-28 10:07:51 -0800337 struct coda_in_hdr ih;
Tao Baod7db5942015-01-28 10:07:51 -0800338 struct CodaFid VFid;
339 int name;
Ben Cheng655a7c02013-10-16 16:09:24 -0700340};
341struct coda_rmdir_out {
Tao Baod7db5942015-01-28 10:07:51 -0800342 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700343};
Ben Cheng655a7c02013-10-16 16:09:24 -0700344struct coda_symlink_in {
Tao Baod7db5942015-01-28 10:07:51 -0800345 struct coda_in_hdr ih;
Tao Baod7db5942015-01-28 10:07:51 -0800346 struct CodaFid VFid;
347 int srcname;
348 struct coda_vattr attr;
349 int tname;
Ben Cheng655a7c02013-10-16 16:09:24 -0700350};
351struct coda_symlink_out {
Tao Baod7db5942015-01-28 10:07:51 -0800352 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700353};
354struct coda_readlink_in {
Tao Baod7db5942015-01-28 10:07:51 -0800355 struct coda_in_hdr ih;
356 struct CodaFid VFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700357};
Tao Baod7db5942015-01-28 10:07:51 -0800358struct coda_readlink_out {
359 struct coda_out_hdr oh;
360 int count;
361 caddr_t data;
Ben Cheng655a7c02013-10-16 16:09:24 -0700362};
363struct coda_fsync_in {
Tao Baod7db5942015-01-28 10:07:51 -0800364 struct coda_in_hdr ih;
365 struct CodaFid VFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700366};
367struct coda_fsync_out {
Tao Baod7db5942015-01-28 10:07:51 -0800368 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700369};
370struct coda_vget_in {
Tao Baod7db5942015-01-28 10:07:51 -0800371 struct coda_in_hdr ih;
372 struct CodaFid VFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700373};
Tao Baod7db5942015-01-28 10:07:51 -0800374struct coda_vget_out {
375 struct coda_out_hdr oh;
376 struct CodaFid VFid;
377 int vtype;
Ben Cheng655a7c02013-10-16 16:09:24 -0700378};
379struct coda_purgeuser_out {
Tao Baod7db5942015-01-28 10:07:51 -0800380 struct coda_out_hdr oh;
381 vuid_t uid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700382};
383struct coda_zapfile_out {
Tao Baod7db5942015-01-28 10:07:51 -0800384 struct coda_out_hdr oh;
385 struct CodaFid CodaFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700386};
387struct coda_zapdir_out {
Tao Baod7db5942015-01-28 10:07:51 -0800388 struct coda_out_hdr oh;
389 struct CodaFid CodaFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700390};
391struct coda_purgefid_out {
Tao Baod7db5942015-01-28 10:07:51 -0800392 struct coda_out_hdr oh;
393 struct CodaFid CodaFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700394};
395struct coda_replace_out {
Tao Baod7db5942015-01-28 10:07:51 -0800396 struct coda_out_hdr oh;
397 struct CodaFid NewFid;
Tao Baod7db5942015-01-28 10:07:51 -0800398 struct CodaFid OldFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700399};
Ben Cheng655a7c02013-10-16 16:09:24 -0700400struct coda_open_by_fd_in {
Tao Baod7db5942015-01-28 10:07:51 -0800401 struct coda_in_hdr ih;
Tao Baod7db5942015-01-28 10:07:51 -0800402 struct CodaFid VFid;
403 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700404};
405struct coda_open_by_fd_out {
Tao Baod7db5942015-01-28 10:07:51 -0800406 struct coda_out_hdr oh;
407 int fd;
Ben Cheng655a7c02013-10-16 16:09:24 -0700408};
409struct coda_open_by_path_in {
Tao Baod7db5942015-01-28 10:07:51 -0800410 struct coda_in_hdr ih;
411 struct CodaFid VFid;
412 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700413};
414struct coda_open_by_path_out {
Tao Baod7db5942015-01-28 10:07:51 -0800415 struct coda_out_hdr oh;
416 int path;
Ben Cheng655a7c02013-10-16 16:09:24 -0700417};
Tao Baod7db5942015-01-28 10:07:51 -0800418struct coda_statfs_in {
419 struct coda_in_hdr in;
Ben Cheng655a7c02013-10-16 16:09:24 -0700420};
421struct coda_statfs_out {
Tao Baod7db5942015-01-28 10:07:51 -0800422 struct coda_out_hdr oh;
423 struct coda_statfs stat;
Ben Cheng655a7c02013-10-16 16:09:24 -0700424};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700425#define CODA_ACCESS_TYPE_READ 1
426#define CODA_ACCESS_TYPE_WRITE 2
427#define CODA_ACCESS_TYPE_MMAP 3
428#define CODA_ACCESS_TYPE_READ_FINISH 4
429#define CODA_ACCESS_TYPE_WRITE_FINISH 5
430struct coda_access_intent_in {
431 struct coda_in_hdr ih;
432 struct CodaFid VFid;
433 int count;
434 int pos;
435 int type;
436};
437struct coda_access_intent_out {
438 struct coda_out_hdr out;
439};
Ben Cheng655a7c02013-10-16 16:09:24 -0700440#define CODA_NOCACHE 0x80000000
441union inputArgs {
Tao Baod7db5942015-01-28 10:07:51 -0800442 struct coda_in_hdr ih;
443 struct coda_open_in coda_open;
444 struct coda_store_in coda_store;
Tao Baod7db5942015-01-28 10:07:51 -0800445 struct coda_release_in coda_release;
446 struct coda_close_in coda_close;
447 struct coda_ioctl_in coda_ioctl;
448 struct coda_getattr_in coda_getattr;
Tao Baod7db5942015-01-28 10:07:51 -0800449 struct coda_setattr_in coda_setattr;
450 struct coda_access_in coda_access;
451 struct coda_lookup_in coda_lookup;
452 struct coda_create_in coda_create;
Tao Baod7db5942015-01-28 10:07:51 -0800453 struct coda_remove_in coda_remove;
454 struct coda_link_in coda_link;
455 struct coda_rename_in coda_rename;
456 struct coda_mkdir_in coda_mkdir;
Tao Baod7db5942015-01-28 10:07:51 -0800457 struct coda_rmdir_in coda_rmdir;
458 struct coda_symlink_in coda_symlink;
459 struct coda_readlink_in coda_readlink;
460 struct coda_fsync_in coda_fsync;
Tao Baod7db5942015-01-28 10:07:51 -0800461 struct coda_vget_in coda_vget;
462 struct coda_open_by_fd_in coda_open_by_fd;
463 struct coda_open_by_path_in coda_open_by_path;
464 struct coda_statfs_in coda_statfs;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700465 struct coda_access_intent_in coda_access_intent;
Ben Cheng655a7c02013-10-16 16:09:24 -0700466};
467union outputArgs {
Tao Baod7db5942015-01-28 10:07:51 -0800468 struct coda_out_hdr oh;
469 struct coda_root_out coda_root;
Tao Baod7db5942015-01-28 10:07:51 -0800470 struct coda_open_out coda_open;
471 struct coda_ioctl_out coda_ioctl;
472 struct coda_getattr_out coda_getattr;
473 struct coda_lookup_out coda_lookup;
Tao Baod7db5942015-01-28 10:07:51 -0800474 struct coda_create_out coda_create;
475 struct coda_mkdir_out coda_mkdir;
476 struct coda_readlink_out coda_readlink;
477 struct coda_vget_out coda_vget;
Tao Baod7db5942015-01-28 10:07:51 -0800478 struct coda_purgeuser_out coda_purgeuser;
479 struct coda_zapfile_out coda_zapfile;
480 struct coda_zapdir_out coda_zapdir;
481 struct coda_purgefid_out coda_purgefid;
Tao Baod7db5942015-01-28 10:07:51 -0800482 struct coda_replace_out coda_replace;
483 struct coda_open_by_fd_out coda_open_by_fd;
484 struct coda_open_by_path_out coda_open_by_path;
485 struct coda_statfs_out coda_statfs;
Ben Cheng655a7c02013-10-16 16:09:24 -0700486};
487union coda_downcalls {
Tao Baod7db5942015-01-28 10:07:51 -0800488 struct coda_purgeuser_out purgeuser;
489 struct coda_zapfile_out zapfile;
Tao Baod7db5942015-01-28 10:07:51 -0800490 struct coda_zapdir_out zapdir;
491 struct coda_purgefid_out purgefid;
492 struct coda_replace_out replace;
Ben Cheng655a7c02013-10-16 16:09:24 -0700493};
494#define PIOCPARM_MASK 0x0000ffff
495struct ViceIoctl {
Elliott Hughes0f0c18f2023-03-29 15:53:31 -0700496 void * in;
497 void * out;
Tao Baod7db5942015-01-28 10:07:51 -0800498 u_short in_size;
499 u_short out_size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700500};
501struct PioctlData {
Elliott Hughes0f0c18f2023-03-29 15:53:31 -0700502 const char * path;
Tao Baod7db5942015-01-28 10:07:51 -0800503 int follow;
504 struct ViceIoctl vi;
Ben Cheng655a7c02013-10-16 16:09:24 -0700505};
506#define CODA_CONTROL ".CONTROL"
507#define CODA_CONTROLLEN 8
Tao Baod7db5942015-01-28 10:07:51 -0800508#define CTL_INO - 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700509#define CODA_MOUNT_VERSION 1
Tao Baod7db5942015-01-28 10:07:51 -0800510struct coda_mount_data {
511 int version;
512 int fd;
Ben Cheng655a7c02013-10-16 16:09:24 -0700513};
Ben Cheng655a7c02013-10-16 16:09:24 -0700514#endif