1/* $NetBSD: coda.h,v 1.19 2015/09/06 06:00:59 dholland Exp $ */
2
3/*
4
5 Coda: an Experimental Distributed File System
6 Release 4.0
7
8 Copyright (c) 1987-1999 Carnegie Mellon University
9 All Rights Reserved
10
11Permission to use, copy, modify and distribute this software and its
12documentation is hereby granted, provided that both the copyright
13notice and this permission notice appear in all copies of the
14software, derivative works or modified versions, and any portions
15thereof, and that both notices appear in supporting documentation, and
16that credit is given to Carnegie Mellon University in all documents
17and publicity pertaining to direct or indirect use of this code or its
18derivatives.
19
20CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
21SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
22FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
23DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
24RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
25ANY DERIVATIVE WORK.
26
27Carnegie Mellon encourages users of this software to return any
28improvements or extensions that they make, and to grant Carnegie
29Mellon the rights to redistribute these changes without encumbrance.
30*/
31
32/*
33 *
34 * Based on cfs.h from Mach, but revamped for increased simplicity.
35 * Linux modifications by
36 * Peter Braam, Aug 1996
37 */
38
39#ifndef _CODA_HEADER_
40#define _CODA_HEADER_
41
42#if defined(__NetBSD__)
43#include <sys/ioccom.h>
44#if defined(_KERNEL_OPT)
45/* pull in optional CODA_COMPAT_5 flag and NVCODA. */
46#include "opt_coda_compat.h"
47#include <vcoda.h>
48#else
49#define NVCODA 4
50#endif
51#endif
52
53/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
54#if defined(__NetBSD__) || \
55 ((defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL))
56#include <sys/types.h>
57#include <sys/systm.h>
58#endif
59
60#ifndef CODA_MAXSYMLINKS
61#define CODA_MAXSYMLINKS 10
62#endif
63
64#if defined(DJGPP) || defined(__CYGWIN32__)
65#ifdef KERNEL
66typedef unsigned long u_long;
67typedef unsigned int u_int;
68typedef unsigned short u_short;
69typedef u_long ino_t;
70typedef u_long dev_t;
71typedef void *void *;
72#ifdef DOS
73typedef unsigned __int64 u_quad_t;
74#else
75typedef unsigned long long u_quad_t;
76#endif
77
78#define inline
79
80struct timespec {
81 long ts_sec;
82 long ts_nsec;
83};
84#else /* DJGPP but not KERNEL */
85#include <sys/time.h>
86typedef unsigned long long u_quad_t;
87#endif /* !KERNEL */
88#endif /* !DJGPP */
89
90
91#if defined(__linux__)
92#define cdev_t u_quad_t
93#ifndef __KERNEL__
94#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
95#define _UQUAD_T_ 1
96typedef unsigned long long u_quad_t;
97#endif
98#else /*__KERNEL__ */
99typedef unsigned long long u_quad_t;
100#endif /* __KERNEL__ */
101#else
102#define cdev_t dev_t
103#endif
104
105/* Solaris Definitions */
106#if defined(sun)
107#include <sys/types.h>
108#include <sys/time.h>
109typedef unsigned long long u_quad_t;
110#undef __BIT_TYPES_DEFINED__
111#endif
112
113/* Mac OS X / Darwin */
114#if defined(__APPLE__) && defined(__MACH__)
115#define __BIT_TYPES_DEFINED__
116#endif
117
118#ifndef __BIT_TYPES_DEFINED__
119#define __BIT_TYPES_DEFINED__
120typedef signed char int8_t;
121typedef unsigned char u_int8_t;
122typedef short int16_t;
123typedef unsigned short u_int16_t;
124typedef int int32_t;
125typedef unsigned int u_int32_t;
126#endif
127
128
129/*
130 * Cfs constants
131 */
132#define CODA_MAXNAMLEN 255
133#define CODA_MAXPATHLEN 1024
134#define CODA_MAXSYMLINK 10
135
136/* these are Coda's version of O_RDONLY etc combinations
137 * to deal with VFS open modes
138 */
139#define C_O_READ 0x001
140#define C_O_WRITE 0x002
141#define C_O_TRUNC 0x010
142#define C_O_EXCL 0x100
143#define C_O_CREAT 0x200
144
145/* these are to find mode bits in Venus */
146#define C_M_READ 00400
147#define C_M_WRITE 00200
148
149/* for access Venus will use */
150#define C_A_C_OK 8 /* Test for writing upon create. */
151#define C_A_R_OK 4 /* Test for read permission. */
152#define C_A_W_OK 2 /* Test for write permission. */
153#define C_A_X_OK 1 /* Test for execute permission. */
154#define C_A_F_OK 0 /* Test for existence. */
155
156#if defined(sun)
157#define _VENUS_DIRENT_T_ 1
158struct venus_dirent {
159 unsigned long d_fileno; /* file number of entry */
160 unsigned short d_reclen; /* length of this record */
161 unsigned short d_namlen; /* length of string in d_name */
162 char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
163};
164#undef DIRSIZ
165#define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
166 (((dp)->d_namlen+1 + 3) &~ 3))
167#endif
168
169#ifndef _VENUS_DIRENT_T_
170#define _VENUS_DIRENT_T_ 1
171struct venus_dirent {
172 unsigned long d_fileno; /* file number of entry */
173 unsigned short d_reclen; /* length of this record */
174 unsigned char d_type; /* file type, see below */
175 unsigned char d_namlen; /* length of string in d_name */
176 char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
177};
178#undef DIRSIZ
179#define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
180 (((dp)->d_namlen+1 + 3) &~ 3))
181
182/*
183 * File types
184 */
185#define CDT_UNKNOWN 0
186#define CDT_FIFO 1
187#define CDT_CHR 2
188#define CDT_DIR 4
189#define CDT_BLK 6
190#define CDT_REG 8
191#define CDT_LNK 10
192#define CDT_SOCK 12
193#define CDT_WHT 14
194
195/*
196 * Convert between stat structure types and directory types.
197 */
198#define IFTOCDT(mode) (((mode) & 0170000) >> 12)
199#define CDTTOIF(dirtype) ((dirtype) << 12)
200
201#endif
202
203#ifdef CODA_COMPAT_5
204
205typedef struct {
206 u_long Volume;
207 u_long Vnode;
208 u_long Unique;
209} CodaFid;
210
211static inline ino_t coda_f2i(CodaFid *fid)
212{
213 if (!fid) return 0;
214 return (fid->Unique + (fid->Vnode<<10) + (fid->Volume<<20));
215}
216
217static inline char * coda_f2s(CodaFid *fid)
218{
219 static char fid_str [35];
220 snprintf (fid_str, 35, "[%lx.%lx.%lx]", fid->Volume,
221 fid->Vnode, fid->Unique);
222 return fid_str;
223}
224
225static inline int coda_fid_eq (CodaFid *fid1, CodaFid *fid2)
226{
227 return (fid1->Volume == fid2->Volume &&
228 fid1->Vnode == fid2->Vnode &&
229 fid1->Unique == fid2->Unique);
230}
231
232struct coda_cred {
233 u_int32_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/
234 u_int32_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
235};
236
237#else
238
239typedef struct {
240 u_int32_t opaque[4];
241} CodaFid;
242
243
244static inline ino_t coda_f2i(CodaFid *fid)
245{
246 if (!fid) return 0;
247 return (fid->opaque[1] + (fid->opaque[2]<<10) + (fid->opaque[3]<<20));
248}
249
250static inline char * coda_f2s(CodaFid *fid)
251{
252 static char fid_str [35];
253 snprintf (fid_str, 35, "[%x.%x.%x.%x]", fid->opaque[0],
254 fid->opaque[1], fid->opaque[2], fid->opaque[3]);
255 return fid_str;
256}
257
258static inline int coda_fid_eq (CodaFid *fid1, CodaFid *fid2)
259{
260 return (fid1->opaque[0] == fid2->opaque[0] &&
261 fid1->opaque[1] == fid2->opaque[1] &&
262 fid1->opaque[2] == fid2->opaque[2] &&
263 fid1->opaque[3] == fid2->opaque[3]);
264}
265
266#endif
267
268#ifndef _VENUS_VATTR_T_
269#define _VENUS_VATTR_T_
270/*
271 * Vnode types. VNON means no type.
272 */
273enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
274
275struct coda_vattr {
276 long va_type; /* vnode type (for create) */
277 u_short va_mode; /* files access mode and type */
278 short va_nlink; /* number of references to file */
279 uid_t va_uid; /* owner user id */
280 gid_t va_gid; /* owner group id */
281 u_long va_fileid; /* file id */
282 u_quad_t va_size; /* file size in bytes */
283 long va_blocksize; /* blocksize preferred for i/o */
284 struct timespec va_atime; /* time of last access */
285 struct timespec va_mtime; /* time of last modification */
286 struct timespec va_ctime; /* time file changed */
287 u_long va_gen; /* generation number of file */
288 u_long va_flags; /* flags defined for file */
289 cdev_t va_rdev; /* device special file represents */
290 u_quad_t va_bytes; /* bytes of disk space held by file */
291 u_quad_t va_filerev; /* file modification number */
292};
293
294#endif
295
296/* structure used by CODA_STATFS for getting cache information from venus */
297struct coda_statfs {
298 int32_t f_blocks;
299 int32_t f_bfree;
300 int32_t f_bavail;
301 int32_t f_files;
302 int32_t f_ffree;
303};
304
305/*
306 * Kernel <--> Venus communications.
307 */
308
309#define CODA_ROOT 2
310#define CODA_OPEN_BY_FD 3
311#define CODA_OPEN 4
312#define CODA_CLOSE 5
313#define CODA_IOCTL 6
314#define CODA_GETATTR 7
315#define CODA_SETATTR 8
316#define CODA_ACCESS 9
317#define CODA_LOOKUP 10
318#define CODA_CREATE 11
319#define CODA_REMOVE 12
320#define CODA_LINK 13
321#define CODA_RENAME 14
322#define CODA_MKDIR 15
323#define CODA_RMDIR 16
324#define CODA_READDIR 17
325#define CODA_SYMLINK 18
326#define CODA_READLINK 19
327#define CODA_FSYNC 20
328#define CODA_INACTIVE 21
329#define CODA_VGET 22
330#define CODA_SIGNAL 23
331#define CODA_REPLACE 24 /* DOWNCALL */
332#define CODA_FLUSH 25 /* DOWNCALL */
333#define CODA_PURGEUSER 26 /* DOWNCALL */
334#define CODA_ZAPFILE 27 /* DOWNCALL */
335#define CODA_ZAPDIR 28 /* DOWNCALL */
336#define CODA_PURGEFID 30 /* DOWNCALL */
337#define CODA_OPEN_BY_PATH 31
338#define CODA_RESOLVE 32
339#define CODA_REINTEGRATE 33
340#define CODA_STATFS 34
341#define CODA_NCALLS 35
342
343#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
344
345#define VC_MAXDATASIZE 8192
346#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\
347 VC_MAXDATASIZE
348
349#define CIOC_KERNEL_VERSION _IOWR('c', 10, sizeof (int))
350
351#if 0
352#define CODA_KERNEL_VERSION 0 /* don't care about kernel version number */
353#define CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */
354#endif
355#ifdef CODA_COMPAT_5
356#define CODA_KERNEL_VERSION 2 /* venus_lookup gets an extra parameter */
357#else
358#define CODA_KERNEL_VERSION 3 /* 128-bit fids for realms */
359#endif
360
361/*
362 * Venus <-> Coda RPC arguments
363 */
364#ifdef CODA_COMPAT_5
365struct coda_in_hdr {
366 unsigned long opcode;
367 unsigned long unique; /* Keep multiple outstanding msgs distinct */
368 u_short pid; /* Common to all */
369 u_short pgid; /* Common to all */
370 u_short sid; /* Common to all */
371 struct coda_cred cred; /* Common to all */
372};
373#else
374struct coda_in_hdr {
375 u_int32_t opcode;
376 u_int32_t unique; /* Keep multiple outstanding msgs distinct */
377 pid_t pid; /* Common to all */
378 pid_t pgid; /* Common to all */
379 uid_t uid; /* Common to all */
380};
381#endif
382
383/* Really important that opcode and unique are 1st two fields! */
384struct coda_out_hdr {
385 u_int32_t opcode;
386 u_int32_t unique;
387 u_int32_t result;
388};
389
390/* coda_root: NO_IN */
391struct coda_root_out {
392 struct coda_out_hdr oh;
393 CodaFid Fid;
394};
395
396struct coda_root_in {
397 struct coda_in_hdr in;
398};
399
400/* coda_open: */
401struct coda_open_in {
402 struct coda_in_hdr ih;
403 CodaFid Fid;
404 int flags;
405};
406
407struct coda_open_out {
408 struct coda_out_hdr oh;
409 cdev_t dev;
410 ino_t inode; /* host inode of container file */
411};
412
413
414/* coda_close: */
415struct coda_close_in {
416 struct coda_in_hdr ih;
417 CodaFid Fid;
418 int flags;
419};
420
421struct coda_close_out {
422 struct coda_out_hdr out;
423};
424
425/* coda_ioctl: */
426struct coda_ioctl_in {
427 struct coda_in_hdr ih;
428 CodaFid Fid;
429 int cmd;
430 int len;
431 int rwflag;
432 char *data; /* Place holder for data. */
433};
434
435struct coda_ioctl_out {
436 struct coda_out_hdr oh;
437 int len;
438 void * data; /* Place holder for data. */
439};
440
441
442/* coda_getattr: */
443struct coda_getattr_in {
444 struct coda_in_hdr ih;
445 CodaFid Fid;
446};
447
448struct coda_getattr_out {
449 struct coda_out_hdr oh;
450 struct coda_vattr attr;
451};
452
453
454/* coda_setattr: NO_OUT */
455struct coda_setattr_in {
456 struct coda_in_hdr ih;
457 CodaFid Fid;
458 struct coda_vattr attr;
459};
460
461struct coda_setattr_out {
462 struct coda_out_hdr out;
463};
464
465/* coda_access: NO_OUT */
466struct coda_access_in {
467 struct coda_in_hdr ih;
468 CodaFid Fid;
469 int flags;
470};
471
472struct coda_access_out {
473 struct coda_out_hdr out;
474};
475
476
477/* lookup flags */
478#define CLU_CASE_SENSITIVE 0x01
479#define CLU_CASE_INSENSITIVE 0x02
480
481/* coda_lookup: */
482struct coda_lookup_in {
483 struct coda_in_hdr ih;
484 CodaFid Fid;
485 int name; /* Place holder for data. */
486 int flags;
487};
488
489struct coda_lookup_out {
490 struct coda_out_hdr oh;
491 CodaFid Fid;
492 int vtype;
493};
494
495
496/* coda_create: */
497struct coda_create_in {
498 struct coda_in_hdr ih;
499 CodaFid Fid;
500 struct coda_vattr attr;
501 int excl;
502 int mode;
503 int name; /* Place holder for data. */
504};
505
506struct coda_create_out {
507 struct coda_out_hdr oh;
508 CodaFid Fid;
509 struct coda_vattr attr;
510};
511
512
513/* coda_remove: NO_OUT */
514struct coda_remove_in {
515 struct coda_in_hdr ih;
516 CodaFid Fid;
517 int name; /* Place holder for data. */
518};
519
520struct coda_remove_out {
521 struct coda_out_hdr out;
522};
523
524/* coda_link: NO_OUT */
525struct coda_link_in {
526 struct coda_in_hdr ih;
527 CodaFid sourceFid; /* cnode to link *to* */
528 CodaFid destFid; /* Directory in which to place link */
529 int tname; /* Place holder for data. */
530};
531
532struct coda_link_out {
533 struct coda_out_hdr out;
534};
535
536
537/* coda_rename: NO_OUT */
538struct coda_rename_in {
539 struct coda_in_hdr ih;
540 CodaFid sourceFid;
541 int srcname;
542 CodaFid destFid;
543 int destname;
544};
545
546struct coda_rename_out {
547 struct coda_out_hdr out;
548};
549
550/* coda_mkdir: */
551struct coda_mkdir_in {
552 struct coda_in_hdr ih;
553 CodaFid Fid;
554 struct coda_vattr attr;
555 int name; /* Place holder for data. */
556};
557
558struct coda_mkdir_out {
559 struct coda_out_hdr oh;
560 CodaFid Fid;
561 struct coda_vattr attr;
562};
563
564
565/* coda_rmdir: NO_OUT */
566struct coda_rmdir_in {
567 struct coda_in_hdr ih;
568 CodaFid Fid;
569 int name; /* Place holder for data. */
570};
571
572struct coda_rmdir_out {
573 struct coda_out_hdr out;
574};
575
576/* coda_readdir: */
577struct coda_readdir_in {
578 struct coda_in_hdr ih;
579 CodaFid Fid;
580 int count;
581 int offset;
582};
583
584struct coda_readdir_out {
585 struct coda_out_hdr oh;
586 int size;
587 void * data; /* Place holder for data. */
588};
589
590/* coda_symlink: NO_OUT */
591struct coda_symlink_in {
592 struct coda_in_hdr ih;
593 CodaFid Fid; /* Directory to put symlink in */
594 int srcname;
595 struct coda_vattr attr;
596 int tname;
597};
598
599struct coda_symlink_out {
600 struct coda_out_hdr out;
601};
602
603/* coda_readlink: */
604struct coda_readlink_in {
605 struct coda_in_hdr ih;
606 CodaFid Fid;
607};
608
609struct coda_readlink_out {
610 struct coda_out_hdr oh;
611 int count;
612 void * data; /* Place holder for data. */
613};
614
615
616/* coda_fsync: NO_OUT */
617struct coda_fsync_in {
618 struct coda_in_hdr ih;
619 CodaFid Fid;
620};
621
622struct coda_fsync_out {
623 struct coda_out_hdr out;
624};
625
626/* coda_vget: */
627struct coda_vget_in {
628 struct coda_in_hdr ih;
629 CodaFid Fid;
630};
631
632struct coda_vget_out {
633 struct coda_out_hdr oh;
634 CodaFid Fid;
635 int vtype;
636};
637
638
639/* CODA_SIGNAL is out-of-band, doesn't need data. */
640/* CODA_INVALIDATE is a venus->kernel call */
641/* CODA_FLUSH is a venus->kernel call */
642
643/* coda_purgeuser: */
644/* CODA_PURGEUSER is a venus->kernel call */
645struct coda_purgeuser_out {
646 struct coda_out_hdr oh;
647#ifdef CODA_COMPAT_5
648 struct coda_cred cred;
649#else
650 uid_t uid;
651#endif
652};
653
654/* coda_zapfile: */
655/* CODA_ZAPFILE is a venus->kernel call */
656struct coda_zapfile_out {
657 struct coda_out_hdr oh;
658 CodaFid Fid;
659};
660
661/* coda_zapdir: */
662/* CODA_ZAPDIR is a venus->kernel call */
663struct coda_zapdir_out {
664 struct coda_out_hdr oh;
665 CodaFid Fid;
666};
667
668/* coda_zapnode: */
669/* CODA_ZAPVNODE is a venus->kernel call */
670struct coda_zapvnode_out {
671 struct coda_out_hdr oh;
672#ifdef CODA_COMPAT_5
673 struct coda_cred cred;
674#endif
675 CodaFid Fid;
676};
677
678/* coda_purgefid: */
679/* CODA_PURGEFID is a venus->kernel call */
680struct coda_purgefid_out {
681 struct coda_out_hdr oh;
682 CodaFid Fid;
683};
684
685/* coda_replace: */
686/* CODA_REPLACE is a venus->kernel call */
687struct coda_replace_out { /* coda_replace is a venus->kernel call */
688 struct coda_out_hdr oh;
689 CodaFid NewFid;
690 CodaFid OldFid;
691};
692
693/* coda_open_by_fd: */
694struct coda_open_by_fd_in {
695 struct coda_in_hdr ih;
696 CodaFid Fid;
697 int flags;
698};
699
700struct coda_open_by_fd_out {
701 struct coda_out_hdr oh;
702 int fd;
703 struct file *fh;
704};
705
706/* coda_open_by_path: */
707struct coda_open_by_path_in {
708 struct coda_in_hdr ih;
709 CodaFid Fid;
710 int flags;
711};
712
713struct coda_open_by_path_out {
714 struct coda_out_hdr oh;
715 int path;
716};
717
718/* coda_statfs: NO_IN */
719struct coda_statfs_in {
720 struct coda_in_hdr ih;
721};
722
723struct coda_statfs_out {
724 struct coda_out_hdr oh;
725 struct coda_statfs stat;
726};
727
728/*
729 * Occasionally, we don't cache the fid returned by CODA_LOOKUP.
730 * For instance, if the fid is inconsistent.
731 * This case is handled by setting the top bit of the type result parameter.
732 */
733#define CODA_NOCACHE 0x80000000
734
735union inputArgs {
736 struct coda_in_hdr ih; /* NB: every struct below begins with an ih */
737 struct coda_open_in coda_open;
738 struct coda_close_in coda_close;
739 struct coda_ioctl_in coda_ioctl;
740 struct coda_getattr_in coda_getattr;
741 struct coda_setattr_in coda_setattr;
742 struct coda_access_in coda_access;
743 struct coda_lookup_in coda_lookup;
744 struct coda_create_in coda_create;
745 struct coda_remove_in coda_remove;
746 struct coda_link_in coda_link;
747 struct coda_rename_in coda_rename;
748 struct coda_mkdir_in coda_mkdir;
749 struct coda_rmdir_in coda_rmdir;
750 struct coda_readdir_in coda_readdir;
751 struct coda_symlink_in coda_symlink;
752 struct coda_readlink_in coda_readlink;
753 struct coda_fsync_in coda_fsync;
754 struct coda_vget_in coda_vget;
755 struct coda_open_by_fd_in coda_open_by_fd;
756 struct coda_open_by_path_in coda_open_by_path;
757 struct coda_statfs_in coda_statfs;
758};
759
760union outputArgs {
761 struct coda_out_hdr oh; /* NB: every struct below begins with an oh */
762 struct coda_root_out coda_root;
763 struct coda_open_out coda_open;
764 struct coda_ioctl_out coda_ioctl;
765 struct coda_getattr_out coda_getattr;
766 struct coda_lookup_out coda_lookup;
767 struct coda_create_out coda_create;
768 struct coda_mkdir_out coda_mkdir;
769 struct coda_readdir_out coda_readdir;
770 struct coda_readlink_out coda_readlink;
771 struct coda_vget_out coda_vget;
772 struct coda_purgeuser_out coda_purgeuser;
773 struct coda_zapfile_out coda_zapfile;
774 struct coda_zapdir_out coda_zapdir;
775 struct coda_zapvnode_out coda_zapvnode;
776 struct coda_purgefid_out coda_purgefid;
777 struct coda_replace_out coda_replace;
778 struct coda_open_by_fd_out coda_open_by_fd;
779 struct coda_open_by_path_out coda_open_by_path;
780 struct coda_statfs_out coda_statfs;
781};
782
783union coda_downcalls {
784 /* CODA_INVALIDATE is a venus->kernel call */
785 /* CODA_FLUSH is a venus->kernel call */
786 struct coda_purgeuser_out purgeuser;
787 struct coda_zapfile_out zapfile;
788 struct coda_zapdir_out zapdir;
789 struct coda_zapvnode_out zapvnode;
790 struct coda_purgefid_out purgefid;
791 struct coda_replace_out replace;
792};
793
794
795/*
796 * Used for identifying usage of "Control" and pioctls
797 */
798
799#define PIOCPARM_MASK 0x0000ffff
800struct ViceIoctl {
801 void *in, *out; /* Data to be transferred in, or out */
802 unsigned short in_size; /* Size of input buffer <= 8K */
803 unsigned short out_size;/* Maximum size of output buffer, <= 8K */
804};
805
806struct PioctlData {
807 const char *path;
808 int follow;
809#if defined(__CYGWIN32__) || defined(__NT_CODA__)
810 int cmd;
811#endif
812 struct ViceIoctl vi;
813};
814
815#define CODA_CONTROL ".CONTROL"
816#define CODA_CONTROLLEN 8
817#define CTL_INO -1
818#define CTL_FILE "/coda/.CONTROL"
819
820
821#ifdef CODA_COMPAT_5
822#define CTL_FID { -1, -1, -1 }
823#define IS_CTL_FID(fidp) ((fidp)->Volume == -1 &&\
824 (fidp)->Vnode == -1 &&\
825 (fidp)->Unique == -1)
826#define INVAL_FID { 0, 0, 0 }
827#else
828#define CTL_FID { { -1, -1, -1, -1 } }
829#define IS_CTL_FID(fidp) ((fidp)->opaque[0] == -1 &&\
830 (fidp)->opaque[1] == -1 &&\
831 (fidp)->opaque[2] == -1 &&\
832 (fidp)->opaque[3] == -1)
833#define INVAL_FID { { 0, 0, 0, 0 } }
834#endif
835
836/* Data passed to mount */
837
838#define CODA_MOUNT_VERSION 1
839
840struct coda_mount_data {
841 int version;
842 int fd; /* Opened device */
843};
844
845#endif
846
847