Refactor afs_NewVCache
[openafs.git] / src / afs / afs_osi.h
index 488334a..ba5e84b 100644 (file)
 #include <sys/condvar.h>
 #endif
 
+#ifdef AFS_NBSD_ENV
+#include <sys/lock.h>
+#endif
+
 #ifdef AFS_LINUX20_ENV
 #ifndef _LINUX_CODA_FS_I
 #define _LINUX_CODA_FS_I
@@ -85,9 +89,9 @@ struct osi_dev {
 };
 
 struct afs_osi_WaitHandle {
-#ifdef AFS_FBSD50_ENV
+#ifdef AFS_FBSD_ENV
     struct cv wh_condvar;
-    int wh_inited;             /* XXX */
+    int wh_inited;
 #else
     caddr_t proc;              /* process waiting */
 #endif
@@ -116,7 +120,7 @@ struct afs_osi_WaitHandle {
 /*
  * Alloc declarations.
  */
-#if !defined(AFS_OBSD44_ENV)
+#if !defined(AFS_OBSD44_ENV) && !defined(AFS_NBSD_ENV)
 #define afs_osi_Alloc_NoSleep afs_osi_Alloc
 #endif
 
@@ -134,6 +138,13 @@ extern struct vnodeops *afs_ops;
 # define       SetAfsVnode(v)      (v)->v_op = afs_ops
 #endif
 
+struct vcache;
+extern int osi_TryEvictVCache(struct vcache *, int *);
+extern struct vcache *osi_NewVnode(void);
+extern void osi_PrePopulateVCache(struct vcache *);
+extern void osi_PostPopulateVCache(struct vcache *);
+extern void osi_AttachVnode(struct vcache *, int seq);
+
 /*
  * In IRIX 6.5 we cannot have DEBUG turned on since certain
  * system-defined structures are a different size with DEBUG on, the
@@ -251,10 +262,16 @@ typedef struct timeval osi_timeval_t;
 /* Bare refcount manipulation would probably work on this platform, but just
    calling VREF does not */
 #define AFS_FAST_HOLD(vp) osi_vnhold((vp),0)
+#elif defined(AFS_AIX_ENV)
+#define AFS_FAST_HOLD(vp) VREFCOUNT_INC(vp)
 #else
 #define AFS_FAST_HOLD(vp) VN_HOLD(AFSTOV(vp))
 #endif
+#ifdef AFS_AIX_ENV
+#define AFS_FAST_RELE(vp) VREFCOUNT_DEC(vp)
+#else
 #define AFS_FAST_RELE(vp) AFS_RELE(AFSTOV(vp))
+#endif
 
 /*
  * MP safe versions of routines to copy memory between user space