diff options
author | rvb <rvb@FreeBSD.org> | 1998-10-28 19:33:50 +0000 |
---|---|---|
committer | rvb <rvb@FreeBSD.org> | 1998-10-28 19:33:50 +0000 |
commit | f3f6c9f429adae171401c8bb886b2e72b7b79447 (patch) | |
tree | a26a4dcfa9c080d458867a19e578e60baa1db7c5 /sys/coda/coda.h | |
parent | 45c6ebc96d5f8b870255823e68e008985d394f31 (diff) | |
download | FreeBSD-src-f3f6c9f429adae171401c8bb886b2e72b7b79447.zip FreeBSD-src-f3f6c9f429adae171401c8bb886b2e72b7b79447.tar.gz |
Venus must be passed O_CREAT flag on VOP_OPEN iff this is
a creat so that we can will allow a mode 444 file to be
written into. Sync with the latest coda.h and deal with
collateral damage.
Diffstat (limited to 'sys/coda/coda.h')
-rw-r--r-- | sys/coda/coda.h | 164 |
1 files changed, 110 insertions, 54 deletions
diff --git a/sys/coda/coda.h b/sys/coda/coda.h index 8e77c20..8426d00 100644 --- a/sys/coda/coda.h +++ b/sys/coda/coda.h @@ -27,7 +27,7 @@ * Mellon the rights to redistribute these changes without encumbrance. * * @(#) src/sys/coda/coda.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ - * $Id: coda.h,v 1.3 1998/09/11 18:50:17 rvb Exp $ + * $Id: coda.h,v 1.4 1998/09/13 13:57:59 rvb Exp $ * */ @@ -40,17 +40,47 @@ #ifndef _CODA_HEADER_ #define _CODA_HEADER_ + + /* Catch new _KERNEL defn for NetBSD */ #ifdef __NetBSD__ #include <sys/types.h> #endif -#if defined(__linux__) || defined(__CYGWIN32__) +#ifndef CODA_MAXSYMLINKS +#define CODA_MAXSYMLINKS 10 +#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; +typedef unsigned long long u_quad_t; + +#define inline + +struct timespec { + long ts_sec; + long ts_nsec; +}; +#else /* DJGPP but not KERNEL */ +#include <sys/types.h> +#include <sys/time.h> +typedef unsigned long long u_quad_t; +#endif /* !KERNEL */ +#endif /* !DJGPP */ + + +#if defined(__linux__) #define cdev_t u_quad_t #if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2) #define _UQUAD_T_ 1 typedef unsigned long long u_quad_t; -#endif +#endif #else #define cdev_t dev_t #endif @@ -65,7 +95,7 @@ struct timespec { /* - * Coda constants + * Cfs constants */ #define CODA_MAXNAMLEN 255 #define CODA_MAXPATHLEN 1024 @@ -78,12 +108,14 @@ struct timespec { #define C_O_WRITE 0x002 #define C_O_TRUNC 0x010 #define C_O_EXCL 0x100 +#define C_O_CREAT 0x200 /* these are to find mode bits in Venus */ #define C_M_READ 00400 #define C_M_WRITE 00200 /* for access Venus will use */ +#define C_A_C_OK 8 /* Test for writing upon create. */ #define C_A_R_OK 4 /* Test for read permission. */ #define C_A_W_OK 2 /* Test for write permission. */ #define C_A_X_OK 1 /* Test for execute permission. */ @@ -108,13 +140,13 @@ struct venus_dirent { * File types */ #define CDT_UNKNOWN 0 -#define CDT_FIFO 1 +#define CDT_FIFO 1 #define CDT_CHR 2 #define CDT_DIR 4 #define CDT_BLK 6 #define CDT_REG 8 #define CDT_LNK 10 -#define CDT_SOCK 12 +#define CDT_SOCK 12 #define CDT_WHT 14 /* @@ -142,32 +174,40 @@ typedef struct ViceFid { } ViceFid; #endif /* VICEFID */ -#ifdef __linux__ -static inline ino_t coda_f2i(struct ViceFid *fid) + +#ifdef __linux__ +static __inline__ ino_t coda_f2i(struct ViceFid *fid) { - if ( fid ) { - return (fid->Unique + (fid->Vnode << 10) + (fid->Volume << 20)); - } else { - return 0; - } + if ( ! fid ) + return 0; + if (fid->Vnode == 0xfffffffe || fid->Vnode == 0xffffffff) + return ((fid->Volume << 20) | (fid->Unique & 0xfffff)); + else + return (fid->Unique + (fid->Vnode<<10) + (fid->Volume<<20)); } + +#else +#define coda_f2i(fid)\ + (fid) ? ((fid)->Unique + ((fid)->Vnode<<10) + ((fid)->Volume<<20)) : 0 +#endif + + +#ifndef __BIT_TYPES_DEFINED__ +#define u_int32_t unsigned int #endif + #ifndef _VUID_T_ #define _VUID_T_ -typedef u_long vuid_t; -typedef u_long vgid_t; +typedef u_int32_t vuid_t; +typedef u_int32_t vgid_t; #endif /*_VUID_T_ */ #ifndef _CODACRED_T_ #define _CODACRED_T_ struct coda_cred { vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/ -#if defined(__NetBSD__) || defined(__FreeBSD__) - vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */ -#else - vgid_t cr_gid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */ -#endif + vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */ }; #endif @@ -179,7 +219,7 @@ struct coda_cred { enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD }; struct coda_vattr { - enum coda_vtype va_type; /* vnode type (for create) */ + int va_type; /* vnode type (for create) */ u_short va_mode; /* files access mode and type */ short va_nlink; /* number of references to file */ vuid_t va_uid; /* owner user id */ @@ -203,36 +243,38 @@ struct coda_vattr { * Kernel <--> Venus communications. */ -#define CODA_ROOT ((u_long) 2) -#define CODA_SYNC ((u_long) 3) -#define CODA_OPEN ((u_long) 4) -#define CODA_CLOSE ((u_long) 5) -#define CODA_IOCTL ((u_long) 6) -#define CODA_GETATTR ((u_long) 7) -#define CODA_SETATTR ((u_long) 8) -#define CODA_ACCESS ((u_long) 9) -#define CODA_LOOKUP ((u_long) 10) -#define CODA_CREATE ((u_long) 11) -#define CODA_REMOVE ((u_long) 12) -#define CODA_LINK ((u_long) 13) -#define CODA_RENAME ((u_long) 14) -#define CODA_MKDIR ((u_long) 15) -#define CODA_RMDIR ((u_long) 16) -#define CODA_READDIR ((u_long) 17) -#define CODA_SYMLINK ((u_long) 18) -#define CODA_READLINK ((u_long) 19) -#define CODA_FSYNC ((u_long) 20) -#define CODA_INACTIVE ((u_long) 21) -#define CODA_VGET ((u_long) 22) -#define CODA_SIGNAL ((u_long) 23) -#define CODA_REPLACE ((u_long) 24) -#define CODA_FLUSH ((u_long) 25) -#define CODA_PURGEUSER ((u_long) 26) -#define CODA_ZAPFILE ((u_long) 27) -#define CODA_ZAPDIR ((u_long) 28) -#define CODA_ZAPVNODE ((u_long) 29) -#define CODA_PURGEFID ((u_long) 30) -#define CODA_NCALLS 31 +#define CODA_ROOT 2 +#define CODA_SYNC 3 +#define CODA_OPEN 4 +#define CODA_CLOSE 5 +#define CODA_IOCTL 6 +#define CODA_GETATTR 7 +#define CODA_SETATTR 8 +#define CODA_ACCESS 9 +#define CODA_LOOKUP 10 +#define CODA_CREATE 11 +#define CODA_REMOVE 12 +#define CODA_LINK 13 +#define CODA_RENAME 14 +#define CODA_MKDIR 15 +#define CODA_RMDIR 16 +#define CODA_READDIR 17 +#define CODA_SYMLINK 18 +#define CODA_READLINK 19 +#define CODA_FSYNC 20 +#define CODA_INACTIVE 21 +#define CODA_VGET 22 +#define CODA_SIGNAL 23 +#define CODA_REPLACE 24 +#define CODA_FLUSH 25 +#define CODA_PURGEUSER 26 +#define CODA_ZAPFILE 27 +#define CODA_ZAPDIR 28 +#define CODA_PURGEFID 30 +#define CODA_OPEN_BY_PATH 31 +#define CODA_RESOLVE 32 +#define CODA_REINTEGRATE 33 +#define CODA_NCALLS 34 #define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID) @@ -580,10 +622,22 @@ struct coda_replace_out { /* coda_replace is a venus->kernel call */ ViceFid OldFid; }; +/* coda_open_by_path: */ +struct coda_open_by_path_in { + struct coda_in_hdr ih; + ViceFid VFid; + int flags; +}; + +struct coda_open_by_path_out { + struct coda_out_hdr oh; + int path; +}; + /* - * Occasionally, 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 - * return result parameter. + * 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 0x80000000 @@ -609,6 +663,7 @@ union inputArgs { struct coda_inactive_in coda_inactive; struct coda_vget_in coda_vget; struct coda_rdwr_in coda_rdwr; + struct coda_open_by_path_in coda_open_by_path; }; union outputArgs { @@ -630,6 +685,7 @@ union outputArgs { struct coda_purgefid_out coda_purgefid; struct coda_rdwr_out coda_rdwr; struct coda_replace_out coda_replace; + struct coda_open_by_path_out coda_open_by_path; }; union coda_downcalls { |