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