dread-do-validation-20041012
[openafs.git] / src / afs / afs_osi.h
index 5d1fc02..9471ba8 100644 (file)
 #include "h/types.h"
 #include "h/param.h"
 
+#ifdef AFS_FBSD50_ENV
+#include <sys/condvar.h>
+#endif
+
 #ifdef AFS_LINUX20_ENV
 #ifndef _LINUX_CODA_FS_I
 #define _LINUX_CODA_FS_I
@@ -68,20 +72,23 @@ struct osi_file {
 };
 
 struct osi_dev {
-#ifdef AFS_OBSD_ENV
+#if defined(AFS_XBSD_ENV)
     struct mount *mp;
     struct vnode *held_vnode;
-#else
-#ifdef AFS_AIX42_ENV
+#elif defined(AFS_AIX42_ENV)
     dev_t dev;
 #else
     afs_int32 dev;
 #endif
-#endif
 };
 
 struct afs_osi_WaitHandle {
+#ifdef AFS_FBSD50_ENV
+    struct cv wh_condvar;
+    int wh_inited;             /* XXX */
+#else
     caddr_t proc;              /* process waiting */
+#endif
 };
 
 #define        osi_SetFileProc(x,p)    ((x)->proc=(p))
@@ -167,7 +174,7 @@ extern struct vnodeops *afs_ops;
   */
 
 
-#if defined(AFS_HPUX_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_LINUX_64BIT_KERNEL) || (defined(AFS_SGI61_ENV) && defined(KERNEL) && defined(_K64U64))
+#if defined(AFS_HPUX_ENV) || (defined(AFS_SUN57_ENV) && !defined(AFS_SUN510_ENV)) || defined(AFS_LINUX_64BIT_KERNEL) || (defined(AFS_SGI61_ENV) && defined(KERNEL) && defined(_K64U64))
 typedef struct {
     afs_int32 tv_sec;
     afs_int32 tv_usec;
@@ -180,9 +187,9 @@ typedef struct timeval osi_timeval_t;
  * The following three routines provide the fid routines used by the buffer
  * and directory packages.
  */
-#define dirp_Zap(afid)    (*(afid) = -1)
-#define dirp_Eq(afid, bfid) (*(afid) == *(bfid))
-#define dirp_Cpy(dfid,sfid) (*(dfid) = *(sfid))
+#define dirp_Zap(afid)    ((afid) = 0)
+#define dirp_Eq(afid, bfid) ((afid) == (bfid))
+#define dirp_Cpy(dfid,sfid) ((dfid) = (sfid))
 
 
 /*
@@ -240,7 +247,6 @@ typedef struct timeval osi_timeval_t;
 #define USERPRI
 #endif
 
-#ifndef AFS_OBSD_ENV
 /*
  * vnode/vcache ref count manipulation
  */
@@ -249,7 +255,6 @@ typedef struct timeval osi_timeval_t;
 #else /* defined(UKERNEL) */
 #define AFS_RELE(vp) do { AFS_GUNLOCK(); VN_RELE(vp); AFS_GLOCK(); } while (0)
 #endif /* defined(UKERNEL) */
-#endif
 
 /*
  * For some reason we do bare refcount manipulation in some places, for some
@@ -396,7 +401,7 @@ typedef struct timeval osi_timeval_t;
 /* Declare any structures which use these macros after the OSI implementation
  * has had the opportunity to redefine them.
  */
-extern struct AFS_UCRED afs_osi_cred;
+extern struct AFS_UCRED afs_osi_cred, *afs_osi_credp;
 
 #ifndef osi_curcred
 #define osi_curcred() (u.u_cred)