linux/include/uapi/linux/coda.h

/* 
   You may distribute this file under either of the two licenses that
   follow at your discretion.
*/

/* BLURB lgpl

                           Coda File System
                              Release 5

          Copyright (c) 1987-1999 Carnegie Mellon University
                  Additional copyrights listed below

This code is distributed "AS IS" without warranty of any kind under
the terms of the GNU Library General Public Licence Version 2, as
shown in the file LICENSE, or under the license shown below. The
technical and financial contributors to Coda are listed in the file
CREDITS.

                        Additional copyrights 
*/

/*

            Coda: an Experimental Distributed File System
                             Release 4.0

          Copyright (c) 1987-1999 Carnegie Mellon University
                         All Rights Reserved

Permission  to  use, copy, modify and distribute this software and its
documentation is hereby granted,  provided  that  both  the  copyright
notice  and  this  permission  notice  appear  in  all  copies  of the
software, derivative works or  modified  versions,  and  any  portions
thereof, and that both notices appear in supporting documentation, and
that credit is given to Carnegie Mellon University  in  all  documents
and publicity pertaining to direct or indirect use of this code or its
derivatives.

CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS  KNOWN  TO  HAVE  BUGS,
SOME  OF  WHICH MAY HAVE SERIOUS CONSEQUENCES.  CARNEGIE MELLON ALLOWS
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.   CARNEGIE  MELLON
DISCLAIMS  ANY  LIABILITY  OF  ANY  KIND  FOR  ANY  DAMAGES WHATSOEVER
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE  OR  OF
ANY DERIVATIVE WORK.

Carnegie  Mellon  encourages  users  of  this  software  to return any
improvements or extensions that  they  make,  and  to  grant  Carnegie
Mellon the rights to redistribute these changes without encumbrance.
*/

/*
 *
 * Based on cfs.h from Mach, but revamped for increased simplicity.
 * Linux modifications by 
 * Peter Braam, Aug 1996
 */

#ifndef _UAPI_CODA_HEADER_
#define _UAPI_CODA_HEADER_


/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
#if defined(__NetBSD__) || \
  ((defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL))
#include <sys/types.h>
#endif 

#ifndef CODA_MAXSYMLINKS
#define CODA_MAXSYMLINKS
#endif

#if defined(DJGPP) || defined(__CYGWIN32__)
#ifdef KERNEL
typedef unsigned long u_long;
typedef unsigned int u_int;
typedef unsigned short u_short;
typedef u_long ino_t;
typedef u_long dev_t;
typedef void * caddr_t;
#ifdef DOS
typedef unsigned __int64 u_quad_t;
#else 
typedef unsigned long long u_quad_t;
#endif

#define inline

#else  /* DJGPP but not KERNEL */
#include <sys/time.h>
typedef unsigned long long u_quad_t;
#endif /* !KERNEL */
#endif /* !DJGPP */


#if defined(__linux__)
#include <linux/time.h>
#define cdev_t
#ifndef __KERNEL__
#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
#define _UQUAD_T_
typedef unsigned long long u_quad_t;
#endif
#endif /* __KERNEL__ */
#else
#define cdev_t
#endif

#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
typedef signed char	      int8_t;
typedef unsigned char	    u_int8_t;
typedef short		     int16_t;
typedef unsigned short	   u_int16_t;
typedef int		     int32_t;
typedef unsigned int	   u_int32_t;
#endif


/*
 * Cfs constants
 */
#define CODA_MAXNAMLEN
#define CODA_MAXPATHLEN
#define CODA_MAXSYMLINK

/* these are Coda's version of O_RDONLY etc combinations
 * to deal with VFS open modes
 */
#define C_O_READ
#define C_O_WRITE
#define C_O_TRUNC
#define C_O_EXCL
#define C_O_CREAT

/* these are to find mode bits in Venus */ 
#define C_M_READ
#define C_M_WRITE

/* for access Venus will use */
#define C_A_C_OK
#define C_A_R_OK
#define C_A_W_OK
#define C_A_X_OK
#define C_A_F_OK



#ifndef _VENUS_DIRENT_T_
#define _VENUS_DIRENT_T_
struct venus_dirent {};
#undef DIRSIZ
#define DIRSIZ(dp)

/*
 * File types
 */
#define CDT_UNKNOWN
#define CDT_FIFO
#define CDT_CHR
#define CDT_DIR
#define CDT_BLK
#define CDT_REG
#define CDT_LNK
#define CDT_SOCK
#define CDT_WHT

/*
 * Convert between stat structure types and directory types.
 */
#define IFTOCDT(mode)
#define CDTTOIF(dirtype)

#endif

#ifndef _VUID_T_
#define _VUID_T_
vuid_t;
vgid_t;
#endif /*_VUID_T_ */

struct CodaFid {};

#define coda_f2i(fid)

#ifndef _VENUS_VATTR_T_
#define _VENUS_VATTR_T_
/*
 * Vnode types.  VNON means no type.
 */
enum coda_vtype	{};

struct coda_timespec {};

struct coda_vattr {};

#endif 

/* structure used by CODA_STATFS for getting cache information from venus */
struct coda_statfs {};

/*
 * Kernel <--> Venus communications.
 */

#define CODA_ROOT
#define CODA_OPEN_BY_FD
#define CODA_OPEN
#define CODA_CLOSE
#define CODA_IOCTL
#define CODA_GETATTR
#define CODA_SETATTR
#define CODA_ACCESS
#define CODA_LOOKUP
#define CODA_CREATE
#define CODA_REMOVE
#define CODA_LINK
#define CODA_RENAME
#define CODA_MKDIR
#define CODA_RMDIR
#define CODA_SYMLINK
#define CODA_READLINK
#define CODA_FSYNC
#define CODA_VGET
#define CODA_SIGNAL
#define CODA_REPLACE
#define CODA_FLUSH
#define CODA_PURGEUSER
#define CODA_ZAPFILE
#define CODA_ZAPDIR
#define CODA_PURGEFID
#define CODA_OPEN_BY_PATH
#define CODA_RESOLVE
#define CODA_REINTEGRATE
#define CODA_STATFS
#define CODA_STORE
#define CODA_RELEASE
#define CODA_ACCESS_INTENT
#define CODA_NCALLS

#define DOWNCALL(opcode)

#define VC_MAXDATASIZE
#define VC_MAXMSGSIZE  

#define CIOC_KERNEL_VERSION

//      CODA_KERNEL_VERSION 0 /* don't care about kernel version number */
//      CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */
//      CODA_KERNEL_VERSION 2 /* venus_lookup gets an extra parameter */
//      CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
//      CODA_KERNEL_VERSION 4 /* 64-bit timespec */
#define CODA_KERNEL_VERSION

/*
 *        Venus <-> Coda  RPC arguments
 */
struct coda_in_hdr {};

/* Really important that opcode and unique are 1st two fields! */
struct coda_out_hdr {};

/* coda_root: NO_IN */
struct coda_root_out {};

struct coda_root_in {};

/* coda_open: */
struct coda_open_in {};

struct coda_open_out {};


/* coda_store: */
struct coda_store_in {};

struct coda_store_out {};

/* coda_release: */
struct coda_release_in {};

struct coda_release_out {};

/* coda_close: */
struct coda_close_in {};

struct coda_close_out {};

/* coda_ioctl: */
struct coda_ioctl_in {};

struct coda_ioctl_out {};


/* coda_getattr: */
struct coda_getattr_in {};

struct coda_getattr_out {};


/* coda_setattr: NO_OUT */
struct coda_setattr_in {};

struct coda_setattr_out {};

/* coda_access: NO_OUT */
struct coda_access_in {};

struct coda_access_out {};


/* lookup flags */
#define CLU_CASE_SENSITIVE
#define CLU_CASE_INSENSITIVE

/* coda_lookup: */
struct  coda_lookup_in {};

struct coda_lookup_out {};


/* coda_create: */
struct coda_create_in {};

struct coda_create_out {};


/* coda_remove: NO_OUT */
struct coda_remove_in {};

struct coda_remove_out {};

/* coda_link: NO_OUT */
struct coda_link_in {};

struct coda_link_out {};


/* coda_rename: NO_OUT */
struct coda_rename_in {};

struct coda_rename_out {};

/* coda_mkdir: */
struct coda_mkdir_in {};

struct coda_mkdir_out {};


/* coda_rmdir: NO_OUT */
struct coda_rmdir_in {};

struct coda_rmdir_out {};

/* coda_symlink: NO_OUT */
struct coda_symlink_in {};

struct coda_symlink_out {};

/* coda_readlink: */
struct coda_readlink_in {};

struct coda_readlink_out {};


/* coda_fsync: NO_OUT */
struct coda_fsync_in {};

struct coda_fsync_out {};

/* coda_vget: */
struct coda_vget_in {};

struct coda_vget_out {};


/* CODA_SIGNAL is out-of-band, doesn't need data. */
/* CODA_INVALIDATE is a venus->kernel call */
/* CODA_FLUSH is a venus->kernel call */

/* coda_purgeuser: */
/* CODA_PURGEUSER is a venus->kernel call */
struct coda_purgeuser_out {};

/* coda_zapfile: */
/* CODA_ZAPFILE is a venus->kernel call */
struct coda_zapfile_out {};

/* coda_zapdir: */
/* CODA_ZAPDIR is a venus->kernel call */	
struct coda_zapdir_out {};

/* coda_purgefid: */
/* CODA_PURGEFID is a venus->kernel call */	
struct coda_purgefid_out {};

/* coda_replace: */
/* CODA_REPLACE is a venus->kernel call */	
struct coda_replace_out {};

/* coda_open_by_fd: */
struct coda_open_by_fd_in {};

struct coda_open_by_fd_out {};

/* coda_open_by_path: */
struct coda_open_by_path_in {};

struct coda_open_by_path_out {};

/* coda_statfs: NO_IN */
struct coda_statfs_in {};

struct coda_statfs_out {};

#define CODA_ACCESS_TYPE_READ
#define CODA_ACCESS_TYPE_WRITE
#define CODA_ACCESS_TYPE_MMAP
#define CODA_ACCESS_TYPE_READ_FINISH
#define CODA_ACCESS_TYPE_WRITE_FINISH

/* coda_access_intent: NO_OUT */
struct coda_access_intent_in {};

struct coda_access_intent_out {};

/* 
 * Occasionally, we don't cache the fid returned by CODA_LOOKUP. 
 * For instance, if the fid is inconsistent. 
 * This case is handled by setting the top bit of the type result parameter.
 */
#define CODA_NOCACHE

inputArgs;

outputArgs;    

coda_downcalls;


/*
 * Used for identifying usage of "Control" and pioctls
 */

#define PIOCPARM_MASK
struct ViceIoctl {};

struct PioctlData {};

#define CODA_CONTROL
#define CODA_CONTROLLEN
#define CTL_INO

/* Data passed to mount */

#define CODA_MOUNT_VERSION

struct coda_mount_data {};

#endif /* _UAPI_CODA_HEADER_ */