blob: aad1b97b05ec30f795305f5f2f066fe974357e6f [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_CODA_HEADER_
20#define _UAPI_CODA_HEADER_
21#if defined(__NetBSD__) || (defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL)
22#include <sys/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#endif
24#ifndef CODA_MAXSYMLINKS
25#define CODA_MAXSYMLINKS 10
26#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070027#if defined(DJGPP) || defined(__CYGWIN32__)
28#ifdef KERNEL
29typedef unsigned long u_long;
30typedef unsigned int u_int;
Ben Cheng655a7c02013-10-16 16:09:24 -070031typedef unsigned short u_short;
32typedef u_long ino_t;
33typedef u_long dev_t;
34typedef void * caddr_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070035#ifdef DOS
36typedef unsigned __int64 u_quad_t;
37#else
38typedef unsigned long long u_quad_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070039#endif
40#define inline
Ben Cheng655a7c02013-10-16 16:09:24 -070041#else
42#include <sys/time.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070043typedef unsigned long long u_quad_t;
44#endif
45#endif
46#ifdef __linux__
Ben Cheng655a7c02013-10-16 16:09:24 -070047#include <linux/time.h>
48#define cdev_t u_quad_t
49#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
50#define _UQUAD_T_ 1
Ben Cheng655a7c02013-10-16 16:09:24 -070051typedef unsigned long long u_quad_t;
52#endif
53#else
54#define cdev_t dev_t
Ben Cheng655a7c02013-10-16 16:09:24 -070055#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070056#ifndef __BIT_TYPES_DEFINED__
Ben Cheng655a7c02013-10-16 16:09:24 -070057#define __BIT_TYPES_DEFINED__
58typedef signed char int8_t;
59typedef unsigned char u_int8_t;
60typedef short int16_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070061typedef unsigned short u_int16_t;
62typedef int int32_t;
63typedef unsigned int u_int32_t;
64#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define CODA_MAXNAMLEN 255
66#define CODA_MAXPATHLEN 1024
67#define CODA_MAXSYMLINK 10
68#define C_O_READ 0x001
Ben Cheng655a7c02013-10-16 16:09:24 -070069#define C_O_WRITE 0x002
70#define C_O_TRUNC 0x010
71#define C_O_EXCL 0x100
72#define C_O_CREAT 0x200
Ben Cheng655a7c02013-10-16 16:09:24 -070073#define C_M_READ 00400
74#define C_M_WRITE 00200
75#define C_A_C_OK 8
76#define C_A_R_OK 4
Ben Cheng655a7c02013-10-16 16:09:24 -070077#define C_A_W_OK 2
78#define C_A_X_OK 1
79#define C_A_F_OK 0
80#ifndef _VENUS_DIRENT_T_
Ben Cheng655a7c02013-10-16 16:09:24 -070081#define _VENUS_DIRENT_T_ 1
82struct venus_dirent {
Tao Baod7db5942015-01-28 10:07:51 -080083 u_int32_t d_fileno;
84 u_int16_t d_reclen;
Tao Baod7db5942015-01-28 10:07:51 -080085 u_int8_t d_type;
86 u_int8_t d_namlen;
87 char d_name[CODA_MAXNAMLEN + 1];
Ben Cheng655a7c02013-10-16 16:09:24 -070088};
Ben Cheng655a7c02013-10-16 16:09:24 -070089#undef DIRSIZ
Tao Baod7db5942015-01-28 10:07:51 -080090#define DIRSIZ(dp) ((sizeof(struct venus_dirent) - (CODA_MAXNAMLEN + 1)) + (((dp)->d_namlen + 1 + 3) & ~3))
Ben Cheng655a7c02013-10-16 16:09:24 -070091#define CDT_UNKNOWN 0
92#define CDT_FIFO 1
Ben Cheng655a7c02013-10-16 16:09:24 -070093#define CDT_CHR 2
94#define CDT_DIR 4
95#define CDT_BLK 6
96#define CDT_REG 8
Ben Cheng655a7c02013-10-16 16:09:24 -070097#define CDT_LNK 10
98#define CDT_SOCK 12
99#define CDT_WHT 14
100#define IFTOCDT(mode) (((mode) & 0170000) >> 12)
Ben Cheng655a7c02013-10-16 16:09:24 -0700101#define CDTTOIF(dirtype) ((dirtype) << 12)
102#endif
103#ifndef _VUID_T_
104#define _VUID_T_
Ben Cheng655a7c02013-10-16 16:09:24 -0700105typedef u_int32_t vuid_t;
106typedef u_int32_t vgid_t;
107#endif
108struct CodaFid {
Tao Baod7db5942015-01-28 10:07:51 -0800109 u_int32_t opaque[4];
Ben Cheng655a7c02013-10-16 16:09:24 -0700110};
Tao Baod7db5942015-01-28 10:07:51 -0800111#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 -0700112#ifndef _VENUS_VATTR_T_
Ben Cheng655a7c02013-10-16 16:09:24 -0700113#define _VENUS_VATTR_T_
Tao Baod7db5942015-01-28 10:07:51 -0800114enum coda_vtype {
115 C_VNON,
116 C_VREG,
Tao Baod7db5942015-01-28 10:07:51 -0800117 C_VDIR,
118 C_VBLK,
119 C_VCHR,
120 C_VLNK,
Tao Baod7db5942015-01-28 10:07:51 -0800121 C_VSOCK,
122 C_VFIFO,
123 C_VBAD
Ben Cheng655a7c02013-10-16 16:09:24 -0700124};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700125struct coda_timespec {
126 int64_t tv_sec;
127 long tv_nsec;
128};
Tao Baod7db5942015-01-28 10:07:51 -0800129struct coda_vattr {
130 long va_type;
131 u_short va_mode;
132 short va_nlink;
Tao Baod7db5942015-01-28 10:07:51 -0800133 vuid_t va_uid;
134 vgid_t va_gid;
135 long va_fileid;
136 u_quad_t va_size;
Tao Baod7db5942015-01-28 10:07:51 -0800137 long va_blocksize;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700138 struct coda_timespec va_atime;
139 struct coda_timespec va_mtime;
140 struct coda_timespec va_ctime;
Tao Baod7db5942015-01-28 10:07:51 -0800141 u_long va_gen;
142 u_long va_flags;
143 cdev_t va_rdev;
144 u_quad_t va_bytes;
Tao Baod7db5942015-01-28 10:07:51 -0800145 u_quad_t va_filerev;
146};
Ben Cheng655a7c02013-10-16 16:09:24 -0700147#endif
148struct coda_statfs {
Tao Baod7db5942015-01-28 10:07:51 -0800149 int32_t f_blocks;
150 int32_t f_bfree;
151 int32_t f_bavail;
152 int32_t f_files;
Tao Baod7db5942015-01-28 10:07:51 -0800153 int32_t f_ffree;
Ben Cheng655a7c02013-10-16 16:09:24 -0700154};
Ben Cheng655a7c02013-10-16 16:09:24 -0700155#define CODA_ROOT 2
156#define CODA_OPEN_BY_FD 3
157#define CODA_OPEN 4
158#define CODA_CLOSE 5
Ben Cheng655a7c02013-10-16 16:09:24 -0700159#define CODA_IOCTL 6
160#define CODA_GETATTR 7
161#define CODA_SETATTR 8
162#define CODA_ACCESS 9
Ben Cheng655a7c02013-10-16 16:09:24 -0700163#define CODA_LOOKUP 10
164#define CODA_CREATE 11
165#define CODA_REMOVE 12
166#define CODA_LINK 13
Ben Cheng655a7c02013-10-16 16:09:24 -0700167#define CODA_RENAME 14
168#define CODA_MKDIR 15
169#define CODA_RMDIR 16
170#define CODA_SYMLINK 18
Ben Cheng655a7c02013-10-16 16:09:24 -0700171#define CODA_READLINK 19
172#define CODA_FSYNC 20
173#define CODA_VGET 22
174#define CODA_SIGNAL 23
Ben Cheng655a7c02013-10-16 16:09:24 -0700175#define CODA_REPLACE 24
176#define CODA_FLUSH 25
177#define CODA_PURGEUSER 26
178#define CODA_ZAPFILE 27
Ben Cheng655a7c02013-10-16 16:09:24 -0700179#define CODA_ZAPDIR 28
180#define CODA_PURGEFID 30
181#define CODA_OPEN_BY_PATH 31
182#define CODA_RESOLVE 32
Ben Cheng655a7c02013-10-16 16:09:24 -0700183#define CODA_REINTEGRATE 33
184#define CODA_STATFS 34
185#define CODA_STORE 35
186#define CODA_RELEASE 36
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700187#define CODA_ACCESS_INTENT 37
188#define CODA_NCALLS 38
Ben Cheng655a7c02013-10-16 16:09:24 -0700189#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
Tao Baod7db5942015-01-28 10:07:51 -0800190#define VC_MAXDATASIZE 8192
191#define VC_MAXMSGSIZE sizeof(union inputArgs) + sizeof(union outputArgs) + VC_MAXDATASIZE
Ben Cheng655a7c02013-10-16 16:09:24 -0700192#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700193#define CODA_KERNEL_VERSION 5
Ben Cheng655a7c02013-10-16 16:09:24 -0700194struct coda_in_hdr {
Tao Baod7db5942015-01-28 10:07:51 -0800195 u_int32_t opcode;
196 u_int32_t unique;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700197 __kernel_pid_t pid;
198 __kernel_pid_t pgid;
Tao Baod7db5942015-01-28 10:07:51 -0800199 vuid_t uid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700200};
201struct coda_out_hdr {
Tao Baod7db5942015-01-28 10:07:51 -0800202 u_int32_t opcode;
203 u_int32_t unique;
204 u_int32_t result;
Ben Cheng655a7c02013-10-16 16:09:24 -0700205};
206struct coda_root_out {
Tao Baod7db5942015-01-28 10:07:51 -0800207 struct coda_out_hdr oh;
208 struct CodaFid VFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700209};
Tao Baod7db5942015-01-28 10:07:51 -0800210struct coda_root_in {
211 struct coda_in_hdr in;
Ben Cheng655a7c02013-10-16 16:09:24 -0700212};
213struct coda_open_in {
Tao Baod7db5942015-01-28 10:07:51 -0800214 struct coda_in_hdr ih;
215 struct CodaFid VFid;
216 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700217};
Tao Baod7db5942015-01-28 10:07:51 -0800218struct coda_open_out {
219 struct coda_out_hdr oh;
220 cdev_t dev;
221 ino_t inode;
Ben Cheng655a7c02013-10-16 16:09:24 -0700222};
223struct coda_store_in {
Tao Baod7db5942015-01-28 10:07:51 -0800224 struct coda_in_hdr ih;
225 struct CodaFid VFid;
Tao Baod7db5942015-01-28 10:07:51 -0800226 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700227};
Ben Cheng655a7c02013-10-16 16:09:24 -0700228struct coda_store_out {
Tao Baod7db5942015-01-28 10:07:51 -0800229 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700230};
231struct coda_release_in {
Tao Baod7db5942015-01-28 10:07:51 -0800232 struct coda_in_hdr ih;
233 struct CodaFid VFid;
Tao Baod7db5942015-01-28 10:07:51 -0800234 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700235};
Ben Cheng655a7c02013-10-16 16:09:24 -0700236struct coda_release_out {
Tao Baod7db5942015-01-28 10:07:51 -0800237 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700238};
239struct coda_close_in {
Tao Baod7db5942015-01-28 10:07:51 -0800240 struct coda_in_hdr ih;
241 struct CodaFid VFid;
Tao Baod7db5942015-01-28 10:07:51 -0800242 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700243};
Ben Cheng655a7c02013-10-16 16:09:24 -0700244struct coda_close_out {
Tao Baod7db5942015-01-28 10:07:51 -0800245 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700246};
247struct coda_ioctl_in {
Tao Baod7db5942015-01-28 10:07:51 -0800248 struct coda_in_hdr ih;
249 struct CodaFid VFid;
Tao Baod7db5942015-01-28 10:07:51 -0800250 int cmd;
251 int len;
252 int rwflag;
253 char * data;
Ben Cheng655a7c02013-10-16 16:09:24 -0700254};
255struct coda_ioctl_out {
Tao Baod7db5942015-01-28 10:07:51 -0800256 struct coda_out_hdr oh;
257 int len;
Tao Baod7db5942015-01-28 10:07:51 -0800258 caddr_t data;
Ben Cheng655a7c02013-10-16 16:09:24 -0700259};
Ben Cheng655a7c02013-10-16 16:09:24 -0700260struct coda_getattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800261 struct coda_in_hdr ih;
Tao Baod7db5942015-01-28 10:07:51 -0800262 struct CodaFid VFid;
263};
Ben Cheng655a7c02013-10-16 16:09:24 -0700264struct coda_getattr_out {
Tao Baod7db5942015-01-28 10:07:51 -0800265 struct coda_out_hdr oh;
Tao Baod7db5942015-01-28 10:07:51 -0800266 struct coda_vattr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700267};
Ben Cheng655a7c02013-10-16 16:09:24 -0700268struct coda_setattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800269 struct coda_in_hdr ih;
Tao Baod7db5942015-01-28 10:07:51 -0800270 struct CodaFid VFid;
271 struct coda_vattr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700272};
273struct coda_setattr_out {
Tao Baod7db5942015-01-28 10:07:51 -0800274 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700275};
Ben Cheng655a7c02013-10-16 16:09:24 -0700276struct coda_access_in {
Tao Baod7db5942015-01-28 10:07:51 -0800277 struct coda_in_hdr ih;
Tao Baod7db5942015-01-28 10:07:51 -0800278 struct CodaFid VFid;
279 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700280};
281struct coda_access_out {
Tao Baod7db5942015-01-28 10:07:51 -0800282 struct coda_out_hdr out;
283};
Ben Cheng655a7c02013-10-16 16:09:24 -0700284#define CLU_CASE_SENSITIVE 0x01
285#define CLU_CASE_INSENSITIVE 0x02
286struct coda_lookup_in {
Tao Baod7db5942015-01-28 10:07:51 -0800287 struct coda_in_hdr ih;
288 struct CodaFid VFid;
289 int name;
Tao Baod7db5942015-01-28 10:07:51 -0800290 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700291};
Ben Cheng655a7c02013-10-16 16:09:24 -0700292struct coda_lookup_out {
Tao Baod7db5942015-01-28 10:07:51 -0800293 struct coda_out_hdr oh;
Tao Baod7db5942015-01-28 10:07:51 -0800294 struct CodaFid VFid;
295 int vtype;
Ben Cheng655a7c02013-10-16 16:09:24 -0700296};
297struct coda_create_in {
Tao Baod7db5942015-01-28 10:07:51 -0800298 struct coda_in_hdr ih;
299 struct CodaFid VFid;
300 struct coda_vattr attr;
301 int excl;
Tao Baod7db5942015-01-28 10:07:51 -0800302 int mode;
303 int name;
Ben Cheng655a7c02013-10-16 16:09:24 -0700304};
305struct coda_create_out {
Tao Baod7db5942015-01-28 10:07:51 -0800306 struct coda_out_hdr oh;
307 struct CodaFid VFid;
308 struct coda_vattr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700309};
Tao Baod7db5942015-01-28 10:07:51 -0800310struct coda_remove_in {
311 struct coda_in_hdr ih;
312 struct CodaFid VFid;
313 int name;
Ben Cheng655a7c02013-10-16 16:09:24 -0700314};
315struct coda_remove_out {
Tao Baod7db5942015-01-28 10:07:51 -0800316 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700317};
318struct coda_link_in {
Tao Baod7db5942015-01-28 10:07:51 -0800319 struct coda_in_hdr ih;
320 struct CodaFid sourceFid;
321 struct CodaFid destFid;
Tao Baod7db5942015-01-28 10:07:51 -0800322 int tname;
Ben Cheng655a7c02013-10-16 16:09:24 -0700323};
Ben Cheng655a7c02013-10-16 16:09:24 -0700324struct coda_link_out {
Tao Baod7db5942015-01-28 10:07:51 -0800325 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700326};
327struct coda_rename_in {
Tao Baod7db5942015-01-28 10:07:51 -0800328 struct coda_in_hdr ih;
329 struct CodaFid sourceFid;
Tao Baod7db5942015-01-28 10:07:51 -0800330 int srcname;
331 struct CodaFid destFid;
332 int destname;
Ben Cheng655a7c02013-10-16 16:09:24 -0700333};
Tao Baod7db5942015-01-28 10:07:51 -0800334struct coda_rename_out {
335 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700336};
337struct coda_mkdir_in {
Tao Baod7db5942015-01-28 10:07:51 -0800338 struct coda_in_hdr ih;
339 struct CodaFid VFid;
340 struct coda_vattr attr;
341 int name;
Ben Cheng655a7c02013-10-16 16:09:24 -0700342};
343struct coda_mkdir_out {
Tao Baod7db5942015-01-28 10:07:51 -0800344 struct coda_out_hdr oh;
345 struct CodaFid VFid;
Tao Baod7db5942015-01-28 10:07:51 -0800346 struct coda_vattr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700347};
Ben Cheng655a7c02013-10-16 16:09:24 -0700348struct coda_rmdir_in {
Tao Baod7db5942015-01-28 10:07:51 -0800349 struct coda_in_hdr ih;
Tao Baod7db5942015-01-28 10:07:51 -0800350 struct CodaFid VFid;
351 int name;
Ben Cheng655a7c02013-10-16 16:09:24 -0700352};
353struct coda_rmdir_out {
Tao Baod7db5942015-01-28 10:07:51 -0800354 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700355};
Ben Cheng655a7c02013-10-16 16:09:24 -0700356struct coda_symlink_in {
Tao Baod7db5942015-01-28 10:07:51 -0800357 struct coda_in_hdr ih;
Tao Baod7db5942015-01-28 10:07:51 -0800358 struct CodaFid VFid;
359 int srcname;
360 struct coda_vattr attr;
361 int tname;
Ben Cheng655a7c02013-10-16 16:09:24 -0700362};
363struct coda_symlink_out {
Tao Baod7db5942015-01-28 10:07:51 -0800364 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700365};
366struct coda_readlink_in {
Tao Baod7db5942015-01-28 10:07:51 -0800367 struct coda_in_hdr ih;
368 struct CodaFid VFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700369};
Tao Baod7db5942015-01-28 10:07:51 -0800370struct coda_readlink_out {
371 struct coda_out_hdr oh;
372 int count;
373 caddr_t data;
Ben Cheng655a7c02013-10-16 16:09:24 -0700374};
375struct coda_fsync_in {
Tao Baod7db5942015-01-28 10:07:51 -0800376 struct coda_in_hdr ih;
377 struct CodaFid VFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700378};
379struct coda_fsync_out {
Tao Baod7db5942015-01-28 10:07:51 -0800380 struct coda_out_hdr out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700381};
382struct coda_vget_in {
Tao Baod7db5942015-01-28 10:07:51 -0800383 struct coda_in_hdr ih;
384 struct CodaFid VFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700385};
Tao Baod7db5942015-01-28 10:07:51 -0800386struct coda_vget_out {
387 struct coda_out_hdr oh;
388 struct CodaFid VFid;
389 int vtype;
Ben Cheng655a7c02013-10-16 16:09:24 -0700390};
391struct coda_purgeuser_out {
Tao Baod7db5942015-01-28 10:07:51 -0800392 struct coda_out_hdr oh;
393 vuid_t uid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700394};
395struct coda_zapfile_out {
Tao Baod7db5942015-01-28 10:07:51 -0800396 struct coda_out_hdr oh;
397 struct CodaFid CodaFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700398};
399struct coda_zapdir_out {
Tao Baod7db5942015-01-28 10:07:51 -0800400 struct coda_out_hdr oh;
401 struct CodaFid CodaFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700402};
403struct coda_purgefid_out {
Tao Baod7db5942015-01-28 10:07:51 -0800404 struct coda_out_hdr oh;
405 struct CodaFid CodaFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700406};
407struct coda_replace_out {
Tao Baod7db5942015-01-28 10:07:51 -0800408 struct coda_out_hdr oh;
409 struct CodaFid NewFid;
Tao Baod7db5942015-01-28 10:07:51 -0800410 struct CodaFid OldFid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700411};
Ben Cheng655a7c02013-10-16 16:09:24 -0700412struct coda_open_by_fd_in {
Tao Baod7db5942015-01-28 10:07:51 -0800413 struct coda_in_hdr ih;
Tao Baod7db5942015-01-28 10:07:51 -0800414 struct CodaFid VFid;
415 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700416};
417struct coda_open_by_fd_out {
Tao Baod7db5942015-01-28 10:07:51 -0800418 struct coda_out_hdr oh;
419 int fd;
Ben Cheng655a7c02013-10-16 16:09:24 -0700420};
421struct coda_open_by_path_in {
Tao Baod7db5942015-01-28 10:07:51 -0800422 struct coda_in_hdr ih;
423 struct CodaFid VFid;
424 int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700425};
426struct coda_open_by_path_out {
Tao Baod7db5942015-01-28 10:07:51 -0800427 struct coda_out_hdr oh;
428 int path;
Ben Cheng655a7c02013-10-16 16:09:24 -0700429};
Tao Baod7db5942015-01-28 10:07:51 -0800430struct coda_statfs_in {
431 struct coda_in_hdr in;
Ben Cheng655a7c02013-10-16 16:09:24 -0700432};
433struct coda_statfs_out {
Tao Baod7db5942015-01-28 10:07:51 -0800434 struct coda_out_hdr oh;
435 struct coda_statfs stat;
Ben Cheng655a7c02013-10-16 16:09:24 -0700436};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700437#define CODA_ACCESS_TYPE_READ 1
438#define CODA_ACCESS_TYPE_WRITE 2
439#define CODA_ACCESS_TYPE_MMAP 3
440#define CODA_ACCESS_TYPE_READ_FINISH 4
441#define CODA_ACCESS_TYPE_WRITE_FINISH 5
442struct coda_access_intent_in {
443 struct coda_in_hdr ih;
444 struct CodaFid VFid;
445 int count;
446 int pos;
447 int type;
448};
449struct coda_access_intent_out {
450 struct coda_out_hdr out;
451};
Ben Cheng655a7c02013-10-16 16:09:24 -0700452#define CODA_NOCACHE 0x80000000
453union inputArgs {
Tao Baod7db5942015-01-28 10:07:51 -0800454 struct coda_in_hdr ih;
455 struct coda_open_in coda_open;
456 struct coda_store_in coda_store;
Tao Baod7db5942015-01-28 10:07:51 -0800457 struct coda_release_in coda_release;
458 struct coda_close_in coda_close;
459 struct coda_ioctl_in coda_ioctl;
460 struct coda_getattr_in coda_getattr;
Tao Baod7db5942015-01-28 10:07:51 -0800461 struct coda_setattr_in coda_setattr;
462 struct coda_access_in coda_access;
463 struct coda_lookup_in coda_lookup;
464 struct coda_create_in coda_create;
Tao Baod7db5942015-01-28 10:07:51 -0800465 struct coda_remove_in coda_remove;
466 struct coda_link_in coda_link;
467 struct coda_rename_in coda_rename;
468 struct coda_mkdir_in coda_mkdir;
Tao Baod7db5942015-01-28 10:07:51 -0800469 struct coda_rmdir_in coda_rmdir;
470 struct coda_symlink_in coda_symlink;
471 struct coda_readlink_in coda_readlink;
472 struct coda_fsync_in coda_fsync;
Tao Baod7db5942015-01-28 10:07:51 -0800473 struct coda_vget_in coda_vget;
474 struct coda_open_by_fd_in coda_open_by_fd;
475 struct coda_open_by_path_in coda_open_by_path;
476 struct coda_statfs_in coda_statfs;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700477 struct coda_access_intent_in coda_access_intent;
Ben Cheng655a7c02013-10-16 16:09:24 -0700478};
479union outputArgs {
Tao Baod7db5942015-01-28 10:07:51 -0800480 struct coda_out_hdr oh;
481 struct coda_root_out coda_root;
Tao Baod7db5942015-01-28 10:07:51 -0800482 struct coda_open_out coda_open;
483 struct coda_ioctl_out coda_ioctl;
484 struct coda_getattr_out coda_getattr;
485 struct coda_lookup_out coda_lookup;
Tao Baod7db5942015-01-28 10:07:51 -0800486 struct coda_create_out coda_create;
487 struct coda_mkdir_out coda_mkdir;
488 struct coda_readlink_out coda_readlink;
489 struct coda_vget_out coda_vget;
Tao Baod7db5942015-01-28 10:07:51 -0800490 struct coda_purgeuser_out coda_purgeuser;
491 struct coda_zapfile_out coda_zapfile;
492 struct coda_zapdir_out coda_zapdir;
493 struct coda_purgefid_out coda_purgefid;
Tao Baod7db5942015-01-28 10:07:51 -0800494 struct coda_replace_out coda_replace;
495 struct coda_open_by_fd_out coda_open_by_fd;
496 struct coda_open_by_path_out coda_open_by_path;
497 struct coda_statfs_out coda_statfs;
Ben Cheng655a7c02013-10-16 16:09:24 -0700498};
499union coda_downcalls {
Tao Baod7db5942015-01-28 10:07:51 -0800500 struct coda_purgeuser_out purgeuser;
501 struct coda_zapfile_out zapfile;
Tao Baod7db5942015-01-28 10:07:51 -0800502 struct coda_zapdir_out zapdir;
503 struct coda_purgefid_out purgefid;
504 struct coda_replace_out replace;
Ben Cheng655a7c02013-10-16 16:09:24 -0700505};
506#define PIOCPARM_MASK 0x0000ffff
507struct ViceIoctl {
Tao Baod7db5942015-01-28 10:07:51 -0800508 void __user * in;
509 void __user * out;
Tao Baod7db5942015-01-28 10:07:51 -0800510 u_short in_size;
511 u_short out_size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700512};
513struct PioctlData {
Tao Baod7db5942015-01-28 10:07:51 -0800514 const char __user * path;
515 int follow;
516 struct ViceIoctl vi;
Ben Cheng655a7c02013-10-16 16:09:24 -0700517};
518#define CODA_CONTROL ".CONTROL"
519#define CODA_CONTROLLEN 8
Tao Baod7db5942015-01-28 10:07:51 -0800520#define CTL_INO - 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700521#define CODA_MOUNT_VERSION 1
Tao Baod7db5942015-01-28 10:07:51 -0800522struct coda_mount_data {
523 int version;
524 int fd;
Ben Cheng655a7c02013-10-16 16:09:24 -0700525};
Ben Cheng655a7c02013-10-16 16:09:24 -0700526#endif