afs: afs_osi_Alloc_NoSleep() cleanup
[openafs.git] / src / afs / afs_osi.h
index ba5e84b..2bb57f5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
@@ -13,7 +13,7 @@
 #include "h/types.h"
 #include "h/param.h"
 
-#ifdef AFS_FBSD50_ENV
+#ifdef AFS_FBSD_ENV
 #include <sys/condvar.h>
 #endif
 
@@ -37,6 +37,13 @@ struct xfs_inode_info {
 #include "h/mm.h"
 #endif
 
+#if defined(AFS_NBSD50_ENV)
+# if !defined(DEF_CADDR_T)
+typedef char * caddr_t;
+#define DEF_CADDR_T
+# endif
+#endif
+
 
 /* this is just a dummy type decl, we're really using struct sockets here */
 struct osi_socket {
@@ -117,12 +124,6 @@ struct afs_osi_WaitHandle {
 
 #define        osi_NPACKETS    20      /* number of cluster pkts to alloc */
 
-/*
- * Alloc declarations.
- */
-#if !defined(AFS_OBSD44_ENV) && !defined(AFS_NBSD_ENV)
-#define afs_osi_Alloc_NoSleep afs_osi_Alloc
-#endif
 
 /*
  * Default vnode related macros
@@ -160,7 +161,7 @@ extern void osi_AttachVnode(struct vcache *, int seq);
 #endif
 #endif
 
-/* 
+/*
  * Time related macros
  */
 #define osi_GetuTime(x) osi_GetTime(x)
@@ -194,7 +195,7 @@ typedef struct timeval osi_timeval_t;
  * is going on in the system.  So if ps cannot show thread IDs it is
  * likely to be the process ID instead.
  */
-#ifdef AFS_FBSD50_ENV
+#ifdef AFS_FBSD_ENV
 /* should use curthread, but 'ps' can't display it */
 #define osi_ThreadUnique()     (curproc->p_pid)
 #elif defined(AFS_LINUX_ENV)
@@ -258,15 +259,9 @@ typedef struct timeval osi_timeval_t;
  * (Also, of course, the vnode is assumed to be one of ours.  Can't use this
  * macro for V-file vnodes.)
  */
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-/* 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
+/* osi_vnhold is defined in PLATFORM/osi_machdep.h */
+#define AFS_FAST_HOLD(vp) osi_vnhold((vp), 0)
+
 #ifdef AFS_AIX_ENV
 #define AFS_FAST_RELE(vp) VREFCOUNT_DEC(vp)
 #else
@@ -374,7 +369,7 @@ typedef struct timeval osi_timeval_t;
            uio_setrw((UIO),(RW));                              \
            CODE = uiomove((SRC),(LEN),(UIO));                  \
        } while(0)
-#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_DARWIN_ENV) || (defined(AFS_XBSD_ENV) && !defined(AFS_NBSD40_ENV))
 #define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE)                       \
        do {                                                    \
            (UIO)->uio_rw = (RW);                               \
@@ -427,7 +422,7 @@ typedef struct timeval osi_timeval_t;
 
 
 /*
-** Macro for Solaris 2.6 returns 1 if file is larger than 2GB; else returns 0 
+** Macro for Solaris 2.6 returns 1 if file is larger than 2GB; else returns 0
 */
 #define AfsLargeFileUio(uio)       0
 #define AfsLargeFileSize(pos, off) 0