xref: /aosp_15_r20/bionic/libc/kernel/uapi/linux/coda.h (revision 8d67ca893c1523eb926b9080dbe4e2ffd2a27ba1)
1*8d67ca89SAndroid Build Coastguard Worker /*
2*8d67ca89SAndroid Build Coastguard Worker  * This file is auto-generated. Modifications will be lost.
3*8d67ca89SAndroid Build Coastguard Worker  *
4*8d67ca89SAndroid Build Coastguard Worker  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5*8d67ca89SAndroid Build Coastguard Worker  * for more information.
6*8d67ca89SAndroid Build Coastguard Worker  */
7*8d67ca89SAndroid Build Coastguard Worker #ifndef _UAPI_CODA_HEADER_
8*8d67ca89SAndroid Build Coastguard Worker #define _UAPI_CODA_HEADER_
9*8d67ca89SAndroid Build Coastguard Worker #if defined(__NetBSD__) || (defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL)
10*8d67ca89SAndroid Build Coastguard Worker #include <sys/types.h>
11*8d67ca89SAndroid Build Coastguard Worker #endif
12*8d67ca89SAndroid Build Coastguard Worker #ifndef CODA_MAXSYMLINKS
13*8d67ca89SAndroid Build Coastguard Worker #define CODA_MAXSYMLINKS 10
14*8d67ca89SAndroid Build Coastguard Worker #endif
15*8d67ca89SAndroid Build Coastguard Worker #if defined(DJGPP) || defined(__CYGWIN32__)
16*8d67ca89SAndroid Build Coastguard Worker #ifdef KERNEL
17*8d67ca89SAndroid Build Coastguard Worker typedef unsigned long u_long;
18*8d67ca89SAndroid Build Coastguard Worker typedef unsigned int u_int;
19*8d67ca89SAndroid Build Coastguard Worker typedef unsigned short u_short;
20*8d67ca89SAndroid Build Coastguard Worker typedef u_long ino_t;
21*8d67ca89SAndroid Build Coastguard Worker typedef u_long dev_t;
22*8d67ca89SAndroid Build Coastguard Worker typedef void * caddr_t;
23*8d67ca89SAndroid Build Coastguard Worker #ifdef DOS
24*8d67ca89SAndroid Build Coastguard Worker typedef unsigned __int64 u_quad_t;
25*8d67ca89SAndroid Build Coastguard Worker #else
26*8d67ca89SAndroid Build Coastguard Worker typedef unsigned long long u_quad_t;
27*8d67ca89SAndroid Build Coastguard Worker #endif
28*8d67ca89SAndroid Build Coastguard Worker #define inline
29*8d67ca89SAndroid Build Coastguard Worker #else
30*8d67ca89SAndroid Build Coastguard Worker #include <sys/time.h>
31*8d67ca89SAndroid Build Coastguard Worker typedef unsigned long long u_quad_t;
32*8d67ca89SAndroid Build Coastguard Worker #endif
33*8d67ca89SAndroid Build Coastguard Worker #endif
34*8d67ca89SAndroid Build Coastguard Worker #ifdef __linux__
35*8d67ca89SAndroid Build Coastguard Worker #include <linux/time.h>
36*8d67ca89SAndroid Build Coastguard Worker #define cdev_t u_quad_t
37*8d67ca89SAndroid Build Coastguard Worker #if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
38*8d67ca89SAndroid Build Coastguard Worker #define _UQUAD_T_ 1
39*8d67ca89SAndroid Build Coastguard Worker typedef unsigned long long u_quad_t;
40*8d67ca89SAndroid Build Coastguard Worker #endif
41*8d67ca89SAndroid Build Coastguard Worker #else
42*8d67ca89SAndroid Build Coastguard Worker #define cdev_t dev_t
43*8d67ca89SAndroid Build Coastguard Worker #endif
44*8d67ca89SAndroid Build Coastguard Worker #ifndef __BIT_TYPES_DEFINED__
45*8d67ca89SAndroid Build Coastguard Worker #define __BIT_TYPES_DEFINED__
46*8d67ca89SAndroid Build Coastguard Worker typedef signed char int8_t;
47*8d67ca89SAndroid Build Coastguard Worker typedef unsigned char u_int8_t;
48*8d67ca89SAndroid Build Coastguard Worker typedef short int16_t;
49*8d67ca89SAndroid Build Coastguard Worker typedef unsigned short u_int16_t;
50*8d67ca89SAndroid Build Coastguard Worker typedef int int32_t;
51*8d67ca89SAndroid Build Coastguard Worker typedef unsigned int u_int32_t;
52*8d67ca89SAndroid Build Coastguard Worker #endif
53*8d67ca89SAndroid Build Coastguard Worker #define CODA_MAXNAMLEN 255
54*8d67ca89SAndroid Build Coastguard Worker #define CODA_MAXPATHLEN 1024
55*8d67ca89SAndroid Build Coastguard Worker #define CODA_MAXSYMLINK 10
56*8d67ca89SAndroid Build Coastguard Worker #define C_O_READ 0x001
57*8d67ca89SAndroid Build Coastguard Worker #define C_O_WRITE 0x002
58*8d67ca89SAndroid Build Coastguard Worker #define C_O_TRUNC 0x010
59*8d67ca89SAndroid Build Coastguard Worker #define C_O_EXCL 0x100
60*8d67ca89SAndroid Build Coastguard Worker #define C_O_CREAT 0x200
61*8d67ca89SAndroid Build Coastguard Worker #define C_M_READ 00400
62*8d67ca89SAndroid Build Coastguard Worker #define C_M_WRITE 00200
63*8d67ca89SAndroid Build Coastguard Worker #define C_A_C_OK 8
64*8d67ca89SAndroid Build Coastguard Worker #define C_A_R_OK 4
65*8d67ca89SAndroid Build Coastguard Worker #define C_A_W_OK 2
66*8d67ca89SAndroid Build Coastguard Worker #define C_A_X_OK 1
67*8d67ca89SAndroid Build Coastguard Worker #define C_A_F_OK 0
68*8d67ca89SAndroid Build Coastguard Worker #ifndef _VENUS_DIRENT_T_
69*8d67ca89SAndroid Build Coastguard Worker #define _VENUS_DIRENT_T_ 1
70*8d67ca89SAndroid Build Coastguard Worker struct venus_dirent {
71*8d67ca89SAndroid Build Coastguard Worker   u_int32_t d_fileno;
72*8d67ca89SAndroid Build Coastguard Worker   u_int16_t d_reclen;
73*8d67ca89SAndroid Build Coastguard Worker   u_int8_t d_type;
74*8d67ca89SAndroid Build Coastguard Worker   u_int8_t d_namlen;
75*8d67ca89SAndroid Build Coastguard Worker   char d_name[CODA_MAXNAMLEN + 1];
76*8d67ca89SAndroid Build Coastguard Worker };
77*8d67ca89SAndroid Build Coastguard Worker #undef DIRSIZ
78*8d67ca89SAndroid Build Coastguard Worker #define DIRSIZ(dp) ((sizeof(struct venus_dirent) - (CODA_MAXNAMLEN + 1)) + (((dp)->d_namlen + 1 + 3) & ~3))
79*8d67ca89SAndroid Build Coastguard Worker #define CDT_UNKNOWN 0
80*8d67ca89SAndroid Build Coastguard Worker #define CDT_FIFO 1
81*8d67ca89SAndroid Build Coastguard Worker #define CDT_CHR 2
82*8d67ca89SAndroid Build Coastguard Worker #define CDT_DIR 4
83*8d67ca89SAndroid Build Coastguard Worker #define CDT_BLK 6
84*8d67ca89SAndroid Build Coastguard Worker #define CDT_REG 8
85*8d67ca89SAndroid Build Coastguard Worker #define CDT_LNK 10
86*8d67ca89SAndroid Build Coastguard Worker #define CDT_SOCK 12
87*8d67ca89SAndroid Build Coastguard Worker #define CDT_WHT 14
88*8d67ca89SAndroid Build Coastguard Worker #define IFTOCDT(mode) (((mode) & 0170000) >> 12)
89*8d67ca89SAndroid Build Coastguard Worker #define CDTTOIF(dirtype) ((dirtype) << 12)
90*8d67ca89SAndroid Build Coastguard Worker #endif
91*8d67ca89SAndroid Build Coastguard Worker #ifndef _VUID_T_
92*8d67ca89SAndroid Build Coastguard Worker #define _VUID_T_
93*8d67ca89SAndroid Build Coastguard Worker typedef u_int32_t vuid_t;
94*8d67ca89SAndroid Build Coastguard Worker typedef u_int32_t vgid_t;
95*8d67ca89SAndroid Build Coastguard Worker #endif
96*8d67ca89SAndroid Build Coastguard Worker struct CodaFid {
97*8d67ca89SAndroid Build Coastguard Worker   u_int32_t opaque[4];
98*8d67ca89SAndroid Build Coastguard Worker };
99*8d67ca89SAndroid Build Coastguard Worker #define coda_f2i(fid) (fid ? (fid->opaque[3] ^ (fid->opaque[2] << 10) ^ (fid->opaque[1] << 20) ^ fid->opaque[0]) : 0)
100*8d67ca89SAndroid Build Coastguard Worker #ifndef _VENUS_VATTR_T_
101*8d67ca89SAndroid Build Coastguard Worker #define _VENUS_VATTR_T_
102*8d67ca89SAndroid Build Coastguard Worker enum coda_vtype {
103*8d67ca89SAndroid Build Coastguard Worker   C_VNON,
104*8d67ca89SAndroid Build Coastguard Worker   C_VREG,
105*8d67ca89SAndroid Build Coastguard Worker   C_VDIR,
106*8d67ca89SAndroid Build Coastguard Worker   C_VBLK,
107*8d67ca89SAndroid Build Coastguard Worker   C_VCHR,
108*8d67ca89SAndroid Build Coastguard Worker   C_VLNK,
109*8d67ca89SAndroid Build Coastguard Worker   C_VSOCK,
110*8d67ca89SAndroid Build Coastguard Worker   C_VFIFO,
111*8d67ca89SAndroid Build Coastguard Worker   C_VBAD
112*8d67ca89SAndroid Build Coastguard Worker };
113*8d67ca89SAndroid Build Coastguard Worker struct coda_timespec {
114*8d67ca89SAndroid Build Coastguard Worker   int64_t tv_sec;
115*8d67ca89SAndroid Build Coastguard Worker   long tv_nsec;
116*8d67ca89SAndroid Build Coastguard Worker };
117*8d67ca89SAndroid Build Coastguard Worker struct coda_vattr {
118*8d67ca89SAndroid Build Coastguard Worker   long va_type;
119*8d67ca89SAndroid Build Coastguard Worker   u_short va_mode;
120*8d67ca89SAndroid Build Coastguard Worker   short va_nlink;
121*8d67ca89SAndroid Build Coastguard Worker   vuid_t va_uid;
122*8d67ca89SAndroid Build Coastguard Worker   vgid_t va_gid;
123*8d67ca89SAndroid Build Coastguard Worker   long va_fileid;
124*8d67ca89SAndroid Build Coastguard Worker   u_quad_t va_size;
125*8d67ca89SAndroid Build Coastguard Worker   long va_blocksize;
126*8d67ca89SAndroid Build Coastguard Worker   struct coda_timespec va_atime;
127*8d67ca89SAndroid Build Coastguard Worker   struct coda_timespec va_mtime;
128*8d67ca89SAndroid Build Coastguard Worker   struct coda_timespec va_ctime;
129*8d67ca89SAndroid Build Coastguard Worker   u_long va_gen;
130*8d67ca89SAndroid Build Coastguard Worker   u_long va_flags;
131*8d67ca89SAndroid Build Coastguard Worker   cdev_t va_rdev;
132*8d67ca89SAndroid Build Coastguard Worker   u_quad_t va_bytes;
133*8d67ca89SAndroid Build Coastguard Worker   u_quad_t va_filerev;
134*8d67ca89SAndroid Build Coastguard Worker };
135*8d67ca89SAndroid Build Coastguard Worker #endif
136*8d67ca89SAndroid Build Coastguard Worker struct coda_statfs {
137*8d67ca89SAndroid Build Coastguard Worker   int32_t f_blocks;
138*8d67ca89SAndroid Build Coastguard Worker   int32_t f_bfree;
139*8d67ca89SAndroid Build Coastguard Worker   int32_t f_bavail;
140*8d67ca89SAndroid Build Coastguard Worker   int32_t f_files;
141*8d67ca89SAndroid Build Coastguard Worker   int32_t f_ffree;
142*8d67ca89SAndroid Build Coastguard Worker };
143*8d67ca89SAndroid Build Coastguard Worker #define CODA_ROOT 2
144*8d67ca89SAndroid Build Coastguard Worker #define CODA_OPEN_BY_FD 3
145*8d67ca89SAndroid Build Coastguard Worker #define CODA_OPEN 4
146*8d67ca89SAndroid Build Coastguard Worker #define CODA_CLOSE 5
147*8d67ca89SAndroid Build Coastguard Worker #define CODA_IOCTL 6
148*8d67ca89SAndroid Build Coastguard Worker #define CODA_GETATTR 7
149*8d67ca89SAndroid Build Coastguard Worker #define CODA_SETATTR 8
150*8d67ca89SAndroid Build Coastguard Worker #define CODA_ACCESS 9
151*8d67ca89SAndroid Build Coastguard Worker #define CODA_LOOKUP 10
152*8d67ca89SAndroid Build Coastguard Worker #define CODA_CREATE 11
153*8d67ca89SAndroid Build Coastguard Worker #define CODA_REMOVE 12
154*8d67ca89SAndroid Build Coastguard Worker #define CODA_LINK 13
155*8d67ca89SAndroid Build Coastguard Worker #define CODA_RENAME 14
156*8d67ca89SAndroid Build Coastguard Worker #define CODA_MKDIR 15
157*8d67ca89SAndroid Build Coastguard Worker #define CODA_RMDIR 16
158*8d67ca89SAndroid Build Coastguard Worker #define CODA_SYMLINK 18
159*8d67ca89SAndroid Build Coastguard Worker #define CODA_READLINK 19
160*8d67ca89SAndroid Build Coastguard Worker #define CODA_FSYNC 20
161*8d67ca89SAndroid Build Coastguard Worker #define CODA_VGET 22
162*8d67ca89SAndroid Build Coastguard Worker #define CODA_SIGNAL 23
163*8d67ca89SAndroid Build Coastguard Worker #define CODA_REPLACE 24
164*8d67ca89SAndroid Build Coastguard Worker #define CODA_FLUSH 25
165*8d67ca89SAndroid Build Coastguard Worker #define CODA_PURGEUSER 26
166*8d67ca89SAndroid Build Coastguard Worker #define CODA_ZAPFILE 27
167*8d67ca89SAndroid Build Coastguard Worker #define CODA_ZAPDIR 28
168*8d67ca89SAndroid Build Coastguard Worker #define CODA_PURGEFID 30
169*8d67ca89SAndroid Build Coastguard Worker #define CODA_OPEN_BY_PATH 31
170*8d67ca89SAndroid Build Coastguard Worker #define CODA_RESOLVE 32
171*8d67ca89SAndroid Build Coastguard Worker #define CODA_REINTEGRATE 33
172*8d67ca89SAndroid Build Coastguard Worker #define CODA_STATFS 34
173*8d67ca89SAndroid Build Coastguard Worker #define CODA_STORE 35
174*8d67ca89SAndroid Build Coastguard Worker #define CODA_RELEASE 36
175*8d67ca89SAndroid Build Coastguard Worker #define CODA_ACCESS_INTENT 37
176*8d67ca89SAndroid Build Coastguard Worker #define CODA_NCALLS 38
177*8d67ca89SAndroid Build Coastguard Worker #define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
178*8d67ca89SAndroid Build Coastguard Worker #define VC_MAXDATASIZE 8192
179*8d67ca89SAndroid Build Coastguard Worker #define VC_MAXMSGSIZE sizeof(union inputArgs) + sizeof(union outputArgs) + VC_MAXDATASIZE
180*8d67ca89SAndroid Build Coastguard Worker #define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
181*8d67ca89SAndroid Build Coastguard Worker #define CODA_KERNEL_VERSION 5
182*8d67ca89SAndroid Build Coastguard Worker struct coda_in_hdr {
183*8d67ca89SAndroid Build Coastguard Worker   u_int32_t opcode;
184*8d67ca89SAndroid Build Coastguard Worker   u_int32_t unique;
185*8d67ca89SAndroid Build Coastguard Worker   __kernel_pid_t pid;
186*8d67ca89SAndroid Build Coastguard Worker   __kernel_pid_t pgid;
187*8d67ca89SAndroid Build Coastguard Worker   vuid_t uid;
188*8d67ca89SAndroid Build Coastguard Worker };
189*8d67ca89SAndroid Build Coastguard Worker struct coda_out_hdr {
190*8d67ca89SAndroid Build Coastguard Worker   u_int32_t opcode;
191*8d67ca89SAndroid Build Coastguard Worker   u_int32_t unique;
192*8d67ca89SAndroid Build Coastguard Worker   u_int32_t result;
193*8d67ca89SAndroid Build Coastguard Worker };
194*8d67ca89SAndroid Build Coastguard Worker struct coda_root_out {
195*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
196*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
197*8d67ca89SAndroid Build Coastguard Worker };
198*8d67ca89SAndroid Build Coastguard Worker struct coda_root_in {
199*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr in;
200*8d67ca89SAndroid Build Coastguard Worker };
201*8d67ca89SAndroid Build Coastguard Worker struct coda_open_in {
202*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
203*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
204*8d67ca89SAndroid Build Coastguard Worker   int flags;
205*8d67ca89SAndroid Build Coastguard Worker };
206*8d67ca89SAndroid Build Coastguard Worker struct coda_open_out {
207*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
208*8d67ca89SAndroid Build Coastguard Worker   cdev_t dev;
209*8d67ca89SAndroid Build Coastguard Worker   ino_t inode;
210*8d67ca89SAndroid Build Coastguard Worker };
211*8d67ca89SAndroid Build Coastguard Worker struct coda_store_in {
212*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
213*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
214*8d67ca89SAndroid Build Coastguard Worker   int flags;
215*8d67ca89SAndroid Build Coastguard Worker };
216*8d67ca89SAndroid Build Coastguard Worker struct coda_store_out {
217*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr out;
218*8d67ca89SAndroid Build Coastguard Worker };
219*8d67ca89SAndroid Build Coastguard Worker struct coda_release_in {
220*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
221*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
222*8d67ca89SAndroid Build Coastguard Worker   int flags;
223*8d67ca89SAndroid Build Coastguard Worker };
224*8d67ca89SAndroid Build Coastguard Worker struct coda_release_out {
225*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr out;
226*8d67ca89SAndroid Build Coastguard Worker };
227*8d67ca89SAndroid Build Coastguard Worker struct coda_close_in {
228*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
229*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
230*8d67ca89SAndroid Build Coastguard Worker   int flags;
231*8d67ca89SAndroid Build Coastguard Worker };
232*8d67ca89SAndroid Build Coastguard Worker struct coda_close_out {
233*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr out;
234*8d67ca89SAndroid Build Coastguard Worker };
235*8d67ca89SAndroid Build Coastguard Worker struct coda_ioctl_in {
236*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
237*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
238*8d67ca89SAndroid Build Coastguard Worker   int cmd;
239*8d67ca89SAndroid Build Coastguard Worker   int len;
240*8d67ca89SAndroid Build Coastguard Worker   int rwflag;
241*8d67ca89SAndroid Build Coastguard Worker   char * data;
242*8d67ca89SAndroid Build Coastguard Worker };
243*8d67ca89SAndroid Build Coastguard Worker struct coda_ioctl_out {
244*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
245*8d67ca89SAndroid Build Coastguard Worker   int len;
246*8d67ca89SAndroid Build Coastguard Worker   caddr_t data;
247*8d67ca89SAndroid Build Coastguard Worker };
248*8d67ca89SAndroid Build Coastguard Worker struct coda_getattr_in {
249*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
250*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
251*8d67ca89SAndroid Build Coastguard Worker };
252*8d67ca89SAndroid Build Coastguard Worker struct coda_getattr_out {
253*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
254*8d67ca89SAndroid Build Coastguard Worker   struct coda_vattr attr;
255*8d67ca89SAndroid Build Coastguard Worker };
256*8d67ca89SAndroid Build Coastguard Worker struct coda_setattr_in {
257*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
258*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
259*8d67ca89SAndroid Build Coastguard Worker   struct coda_vattr attr;
260*8d67ca89SAndroid Build Coastguard Worker };
261*8d67ca89SAndroid Build Coastguard Worker struct coda_setattr_out {
262*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr out;
263*8d67ca89SAndroid Build Coastguard Worker };
264*8d67ca89SAndroid Build Coastguard Worker struct coda_access_in {
265*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
266*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
267*8d67ca89SAndroid Build Coastguard Worker   int flags;
268*8d67ca89SAndroid Build Coastguard Worker };
269*8d67ca89SAndroid Build Coastguard Worker struct coda_access_out {
270*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr out;
271*8d67ca89SAndroid Build Coastguard Worker };
272*8d67ca89SAndroid Build Coastguard Worker #define CLU_CASE_SENSITIVE 0x01
273*8d67ca89SAndroid Build Coastguard Worker #define CLU_CASE_INSENSITIVE 0x02
274*8d67ca89SAndroid Build Coastguard Worker struct coda_lookup_in {
275*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
276*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
277*8d67ca89SAndroid Build Coastguard Worker   int name;
278*8d67ca89SAndroid Build Coastguard Worker   int flags;
279*8d67ca89SAndroid Build Coastguard Worker };
280*8d67ca89SAndroid Build Coastguard Worker struct coda_lookup_out {
281*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
282*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
283*8d67ca89SAndroid Build Coastguard Worker   int vtype;
284*8d67ca89SAndroid Build Coastguard Worker };
285*8d67ca89SAndroid Build Coastguard Worker struct coda_create_in {
286*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
287*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
288*8d67ca89SAndroid Build Coastguard Worker   struct coda_vattr attr;
289*8d67ca89SAndroid Build Coastguard Worker   int excl;
290*8d67ca89SAndroid Build Coastguard Worker   int mode;
291*8d67ca89SAndroid Build Coastguard Worker   int name;
292*8d67ca89SAndroid Build Coastguard Worker };
293*8d67ca89SAndroid Build Coastguard Worker struct coda_create_out {
294*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
295*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
296*8d67ca89SAndroid Build Coastguard Worker   struct coda_vattr attr;
297*8d67ca89SAndroid Build Coastguard Worker };
298*8d67ca89SAndroid Build Coastguard Worker struct coda_remove_in {
299*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
300*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
301*8d67ca89SAndroid Build Coastguard Worker   int name;
302*8d67ca89SAndroid Build Coastguard Worker };
303*8d67ca89SAndroid Build Coastguard Worker struct coda_remove_out {
304*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr out;
305*8d67ca89SAndroid Build Coastguard Worker };
306*8d67ca89SAndroid Build Coastguard Worker struct coda_link_in {
307*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
308*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid sourceFid;
309*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid destFid;
310*8d67ca89SAndroid Build Coastguard Worker   int tname;
311*8d67ca89SAndroid Build Coastguard Worker };
312*8d67ca89SAndroid Build Coastguard Worker struct coda_link_out {
313*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr out;
314*8d67ca89SAndroid Build Coastguard Worker };
315*8d67ca89SAndroid Build Coastguard Worker struct coda_rename_in {
316*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
317*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid sourceFid;
318*8d67ca89SAndroid Build Coastguard Worker   int srcname;
319*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid destFid;
320*8d67ca89SAndroid Build Coastguard Worker   int destname;
321*8d67ca89SAndroid Build Coastguard Worker };
322*8d67ca89SAndroid Build Coastguard Worker struct coda_rename_out {
323*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr out;
324*8d67ca89SAndroid Build Coastguard Worker };
325*8d67ca89SAndroid Build Coastguard Worker struct coda_mkdir_in {
326*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
327*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
328*8d67ca89SAndroid Build Coastguard Worker   struct coda_vattr attr;
329*8d67ca89SAndroid Build Coastguard Worker   int name;
330*8d67ca89SAndroid Build Coastguard Worker };
331*8d67ca89SAndroid Build Coastguard Worker struct coda_mkdir_out {
332*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
333*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
334*8d67ca89SAndroid Build Coastguard Worker   struct coda_vattr attr;
335*8d67ca89SAndroid Build Coastguard Worker };
336*8d67ca89SAndroid Build Coastguard Worker struct coda_rmdir_in {
337*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
338*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
339*8d67ca89SAndroid Build Coastguard Worker   int name;
340*8d67ca89SAndroid Build Coastguard Worker };
341*8d67ca89SAndroid Build Coastguard Worker struct coda_rmdir_out {
342*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr out;
343*8d67ca89SAndroid Build Coastguard Worker };
344*8d67ca89SAndroid Build Coastguard Worker struct coda_symlink_in {
345*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
346*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
347*8d67ca89SAndroid Build Coastguard Worker   int srcname;
348*8d67ca89SAndroid Build Coastguard Worker   struct coda_vattr attr;
349*8d67ca89SAndroid Build Coastguard Worker   int tname;
350*8d67ca89SAndroid Build Coastguard Worker };
351*8d67ca89SAndroid Build Coastguard Worker struct coda_symlink_out {
352*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr out;
353*8d67ca89SAndroid Build Coastguard Worker };
354*8d67ca89SAndroid Build Coastguard Worker struct coda_readlink_in {
355*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
356*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
357*8d67ca89SAndroid Build Coastguard Worker };
358*8d67ca89SAndroid Build Coastguard Worker struct coda_readlink_out {
359*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
360*8d67ca89SAndroid Build Coastguard Worker   int count;
361*8d67ca89SAndroid Build Coastguard Worker   caddr_t data;
362*8d67ca89SAndroid Build Coastguard Worker };
363*8d67ca89SAndroid Build Coastguard Worker struct coda_fsync_in {
364*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
365*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
366*8d67ca89SAndroid Build Coastguard Worker };
367*8d67ca89SAndroid Build Coastguard Worker struct coda_fsync_out {
368*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr out;
369*8d67ca89SAndroid Build Coastguard Worker };
370*8d67ca89SAndroid Build Coastguard Worker struct coda_vget_in {
371*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
372*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
373*8d67ca89SAndroid Build Coastguard Worker };
374*8d67ca89SAndroid Build Coastguard Worker struct coda_vget_out {
375*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
376*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
377*8d67ca89SAndroid Build Coastguard Worker   int vtype;
378*8d67ca89SAndroid Build Coastguard Worker };
379*8d67ca89SAndroid Build Coastguard Worker struct coda_purgeuser_out {
380*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
381*8d67ca89SAndroid Build Coastguard Worker   vuid_t uid;
382*8d67ca89SAndroid Build Coastguard Worker };
383*8d67ca89SAndroid Build Coastguard Worker struct coda_zapfile_out {
384*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
385*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid CodaFid;
386*8d67ca89SAndroid Build Coastguard Worker };
387*8d67ca89SAndroid Build Coastguard Worker struct coda_zapdir_out {
388*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
389*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid CodaFid;
390*8d67ca89SAndroid Build Coastguard Worker };
391*8d67ca89SAndroid Build Coastguard Worker struct coda_purgefid_out {
392*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
393*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid CodaFid;
394*8d67ca89SAndroid Build Coastguard Worker };
395*8d67ca89SAndroid Build Coastguard Worker struct coda_replace_out {
396*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
397*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid NewFid;
398*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid OldFid;
399*8d67ca89SAndroid Build Coastguard Worker };
400*8d67ca89SAndroid Build Coastguard Worker struct coda_open_by_fd_in {
401*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
402*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
403*8d67ca89SAndroid Build Coastguard Worker   int flags;
404*8d67ca89SAndroid Build Coastguard Worker };
405*8d67ca89SAndroid Build Coastguard Worker struct coda_open_by_fd_out {
406*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
407*8d67ca89SAndroid Build Coastguard Worker   int fd;
408*8d67ca89SAndroid Build Coastguard Worker };
409*8d67ca89SAndroid Build Coastguard Worker struct coda_open_by_path_in {
410*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
411*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
412*8d67ca89SAndroid Build Coastguard Worker   int flags;
413*8d67ca89SAndroid Build Coastguard Worker };
414*8d67ca89SAndroid Build Coastguard Worker struct coda_open_by_path_out {
415*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
416*8d67ca89SAndroid Build Coastguard Worker   int path;
417*8d67ca89SAndroid Build Coastguard Worker };
418*8d67ca89SAndroid Build Coastguard Worker struct coda_statfs_in {
419*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr in;
420*8d67ca89SAndroid Build Coastguard Worker };
421*8d67ca89SAndroid Build Coastguard Worker struct coda_statfs_out {
422*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
423*8d67ca89SAndroid Build Coastguard Worker   struct coda_statfs stat;
424*8d67ca89SAndroid Build Coastguard Worker };
425*8d67ca89SAndroid Build Coastguard Worker #define CODA_ACCESS_TYPE_READ 1
426*8d67ca89SAndroid Build Coastguard Worker #define CODA_ACCESS_TYPE_WRITE 2
427*8d67ca89SAndroid Build Coastguard Worker #define CODA_ACCESS_TYPE_MMAP 3
428*8d67ca89SAndroid Build Coastguard Worker #define CODA_ACCESS_TYPE_READ_FINISH 4
429*8d67ca89SAndroid Build Coastguard Worker #define CODA_ACCESS_TYPE_WRITE_FINISH 5
430*8d67ca89SAndroid Build Coastguard Worker struct coda_access_intent_in {
431*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
432*8d67ca89SAndroid Build Coastguard Worker   struct CodaFid VFid;
433*8d67ca89SAndroid Build Coastguard Worker   int count;
434*8d67ca89SAndroid Build Coastguard Worker   int pos;
435*8d67ca89SAndroid Build Coastguard Worker   int type;
436*8d67ca89SAndroid Build Coastguard Worker };
437*8d67ca89SAndroid Build Coastguard Worker struct coda_access_intent_out {
438*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr out;
439*8d67ca89SAndroid Build Coastguard Worker };
440*8d67ca89SAndroid Build Coastguard Worker #define CODA_NOCACHE 0x80000000
441*8d67ca89SAndroid Build Coastguard Worker union inputArgs {
442*8d67ca89SAndroid Build Coastguard Worker   struct coda_in_hdr ih;
443*8d67ca89SAndroid Build Coastguard Worker   struct coda_open_in coda_open;
444*8d67ca89SAndroid Build Coastguard Worker   struct coda_store_in coda_store;
445*8d67ca89SAndroid Build Coastguard Worker   struct coda_release_in coda_release;
446*8d67ca89SAndroid Build Coastguard Worker   struct coda_close_in coda_close;
447*8d67ca89SAndroid Build Coastguard Worker   struct coda_ioctl_in coda_ioctl;
448*8d67ca89SAndroid Build Coastguard Worker   struct coda_getattr_in coda_getattr;
449*8d67ca89SAndroid Build Coastguard Worker   struct coda_setattr_in coda_setattr;
450*8d67ca89SAndroid Build Coastguard Worker   struct coda_access_in coda_access;
451*8d67ca89SAndroid Build Coastguard Worker   struct coda_lookup_in coda_lookup;
452*8d67ca89SAndroid Build Coastguard Worker   struct coda_create_in coda_create;
453*8d67ca89SAndroid Build Coastguard Worker   struct coda_remove_in coda_remove;
454*8d67ca89SAndroid Build Coastguard Worker   struct coda_link_in coda_link;
455*8d67ca89SAndroid Build Coastguard Worker   struct coda_rename_in coda_rename;
456*8d67ca89SAndroid Build Coastguard Worker   struct coda_mkdir_in coda_mkdir;
457*8d67ca89SAndroid Build Coastguard Worker   struct coda_rmdir_in coda_rmdir;
458*8d67ca89SAndroid Build Coastguard Worker   struct coda_symlink_in coda_symlink;
459*8d67ca89SAndroid Build Coastguard Worker   struct coda_readlink_in coda_readlink;
460*8d67ca89SAndroid Build Coastguard Worker   struct coda_fsync_in coda_fsync;
461*8d67ca89SAndroid Build Coastguard Worker   struct coda_vget_in coda_vget;
462*8d67ca89SAndroid Build Coastguard Worker   struct coda_open_by_fd_in coda_open_by_fd;
463*8d67ca89SAndroid Build Coastguard Worker   struct coda_open_by_path_in coda_open_by_path;
464*8d67ca89SAndroid Build Coastguard Worker   struct coda_statfs_in coda_statfs;
465*8d67ca89SAndroid Build Coastguard Worker   struct coda_access_intent_in coda_access_intent;
466*8d67ca89SAndroid Build Coastguard Worker };
467*8d67ca89SAndroid Build Coastguard Worker union outputArgs {
468*8d67ca89SAndroid Build Coastguard Worker   struct coda_out_hdr oh;
469*8d67ca89SAndroid Build Coastguard Worker   struct coda_root_out coda_root;
470*8d67ca89SAndroid Build Coastguard Worker   struct coda_open_out coda_open;
471*8d67ca89SAndroid Build Coastguard Worker   struct coda_ioctl_out coda_ioctl;
472*8d67ca89SAndroid Build Coastguard Worker   struct coda_getattr_out coda_getattr;
473*8d67ca89SAndroid Build Coastguard Worker   struct coda_lookup_out coda_lookup;
474*8d67ca89SAndroid Build Coastguard Worker   struct coda_create_out coda_create;
475*8d67ca89SAndroid Build Coastguard Worker   struct coda_mkdir_out coda_mkdir;
476*8d67ca89SAndroid Build Coastguard Worker   struct coda_readlink_out coda_readlink;
477*8d67ca89SAndroid Build Coastguard Worker   struct coda_vget_out coda_vget;
478*8d67ca89SAndroid Build Coastguard Worker   struct coda_purgeuser_out coda_purgeuser;
479*8d67ca89SAndroid Build Coastguard Worker   struct coda_zapfile_out coda_zapfile;
480*8d67ca89SAndroid Build Coastguard Worker   struct coda_zapdir_out coda_zapdir;
481*8d67ca89SAndroid Build Coastguard Worker   struct coda_purgefid_out coda_purgefid;
482*8d67ca89SAndroid Build Coastguard Worker   struct coda_replace_out coda_replace;
483*8d67ca89SAndroid Build Coastguard Worker   struct coda_open_by_fd_out coda_open_by_fd;
484*8d67ca89SAndroid Build Coastguard Worker   struct coda_open_by_path_out coda_open_by_path;
485*8d67ca89SAndroid Build Coastguard Worker   struct coda_statfs_out coda_statfs;
486*8d67ca89SAndroid Build Coastguard Worker };
487*8d67ca89SAndroid Build Coastguard Worker union coda_downcalls {
488*8d67ca89SAndroid Build Coastguard Worker   struct coda_purgeuser_out purgeuser;
489*8d67ca89SAndroid Build Coastguard Worker   struct coda_zapfile_out zapfile;
490*8d67ca89SAndroid Build Coastguard Worker   struct coda_zapdir_out zapdir;
491*8d67ca89SAndroid Build Coastguard Worker   struct coda_purgefid_out purgefid;
492*8d67ca89SAndroid Build Coastguard Worker   struct coda_replace_out replace;
493*8d67ca89SAndroid Build Coastguard Worker };
494*8d67ca89SAndroid Build Coastguard Worker #define PIOCPARM_MASK 0x0000ffff
495*8d67ca89SAndroid Build Coastguard Worker struct ViceIoctl {
496*8d67ca89SAndroid Build Coastguard Worker   void  * in;
497*8d67ca89SAndroid Build Coastguard Worker   void  * out;
498*8d67ca89SAndroid Build Coastguard Worker   u_short in_size;
499*8d67ca89SAndroid Build Coastguard Worker   u_short out_size;
500*8d67ca89SAndroid Build Coastguard Worker };
501*8d67ca89SAndroid Build Coastguard Worker struct PioctlData {
502*8d67ca89SAndroid Build Coastguard Worker   const char  * path;
503*8d67ca89SAndroid Build Coastguard Worker   int follow;
504*8d67ca89SAndroid Build Coastguard Worker   struct ViceIoctl vi;
505*8d67ca89SAndroid Build Coastguard Worker };
506*8d67ca89SAndroid Build Coastguard Worker #define CODA_CONTROL ".CONTROL"
507*8d67ca89SAndroid Build Coastguard Worker #define CODA_CONTROLLEN 8
508*8d67ca89SAndroid Build Coastguard Worker #define CTL_INO - 1
509*8d67ca89SAndroid Build Coastguard Worker #define CODA_MOUNT_VERSION 1
510*8d67ca89SAndroid Build Coastguard Worker struct coda_mount_data {
511*8d67ca89SAndroid Build Coastguard Worker   int version;
512*8d67ca89SAndroid Build Coastguard Worker   int fd;
513*8d67ca89SAndroid Build Coastguard Worker };
514*8d67ca89SAndroid Build Coastguard Worker #endif
515