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