rx: remove trailing semicolons from FBSD mutex operations
[openafs.git] / src / rx / FBSD / rx_kmutex.h
index 39fe820..660494c 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
@@ -26,7 +26,6 @@
 #endif
 
 #define RX_ENABLE_LOCKS         1
-#define AFS_GLOBAL_RXLOCK_KERNEL
 
 typedef int afs_kcondvar_t;
 
@@ -39,26 +38,25 @@ typedef struct {
 #define MUTEX_INIT(a,b,c,d) \
     do { \
        (a)->owner = 0; \
-    } while(0);
+    } while(0)
 #define MUTEX_DESTROY(a) \
     do { \
        (a)->owner = (struct proc *)-1; \
-    } while(0);
+    } while(0)
 #define MUTEX_ENTER(a) \
     do { \
        osi_Assert((a)->owner == 0); \
        (a)->owner = curproc; \
-    } while(0);
+    } while(0)
 #define MUTEX_TRYENTER(a) \
     ( osi_Assert((a)->owner == 0), (a)->owner = curproc, 1)
 #define MUTEX_EXIT(a) \
     do { \
        osi_Assert((a)->owner == curproc); \
        (a)->owner = 0; \
-    } while(0);
+    } while(0)
 
-#undef MUTEX_ISMINE
-#define MUTEX_ISMINE(a) (((afs_kmutex_t *)(a))->owner == curproc)
+#define MUTEX_ASSERT(a) osi_Assert(((afs_kmutex_t *)(a))->owner == curproc)
 
 #elif defined(AFS_FBSD70_ENV) /* dunno about 6.x */
 
@@ -66,7 +64,7 @@ typedef struct mtx afs_kmutex_t;
 
 #if defined(AFS_FBSD80_ENV) && defined(WITNESS)
 #define WITCLEAR_MTX(a)                                        \
-    do { memset((a), 0, sizeof(struct mtx)); } while(0);
+    do { memset((a), 0, sizeof(struct mtx)); } while(0)
 #else
 #define WITCLEAR_MTX(a) {}
 #endif
@@ -75,17 +73,17 @@ typedef struct mtx afs_kmutex_t;
   do {                                                              \
       WITCLEAR_MTX(a);                                              \
       mtx_init((a), (b), 0 /* type defaults to name */, MTX_DEF | MTX_DUPOK);    \
-  } while(0);
+  } while(0)
 
 #define MUTEX_DESTROY(a)                       \
     do {                                       \
        mtx_destroy((a));                       \
-    } while(0);
+    } while(0)
 
 #define MUTEX_ENTER(a) \
     do {              \
        mtx_lock((a)); \
-    } while(0);
+    } while(0)
 
 #define MUTEX_TRYENTER(a)                      \
     ( mtx_trylock((a)) )
@@ -93,13 +91,12 @@ typedef struct mtx afs_kmutex_t;
 #define MUTEX_EXIT(a)   \
     do {                \
        mtx_unlock((a)); \
-    } while(0);
+    } while(0)
 
-#undef MUTEX_ISMINE
-#define MUTEX_ISMINE(a)                                \
-    ( mtx_owned((a)) )
+#define MUTEX_ASSERT(a)                                \
+    osi_Assert(mtx_owned((a)))
 
-#elif defined(AFS_FBSD50_ENV)
+#else
 
 typedef struct {
     struct lock lock;
@@ -111,17 +108,17 @@ typedef struct {
     do { \
        lockinit(&(a)->lock,PSOCK, "afs rx mutex", 0, 0); \
        (a)->owner = 0; \
-    } while(0);
+    } while(0)
 #define MUTEX_DESTROY(a) \
     do { \
        (a)->owner = (struct proc *)-1; \
-    } while(0);
+    } while(0)
 #define MUTEX_ENTER(a) \
     do { \
        lockmgr(&(a)->lock, LK_EXCLUSIVE, 0, curthread); \
        osi_Assert((a)->owner == 0); \
        (a)->owner = curthread; \
-    } while(0);
+    } while(0)
 #define MUTEX_TRYENTER(a) \
     ( lockmgr(&(a)->lock, LK_EXCLUSIVE|LK_NOWAIT, 0, curthread) ? 0 : ((a)->owner = curthread, 1) )
 #define xMUTEX_TRYENTER(a) \
@@ -131,85 +128,11 @@ typedef struct {
        osi_Assert((a)->owner == curthread); \
        (a)->owner = 0; \
        lockmgr(&(a)->lock, LK_RELEASE, 0, curthread); \
-    } while(0);
-
-#undef MUTEX_ISMINE
-#define MUTEX_ISMINE(a) (((afs_kmutex_t *)(a))->owner == curthread)
-#elif defined(HEAVY_LOCKS)
-typedef struct {
-    struct lock lock;
-    struct proc *owner;
-} afs_kmutex_t;
-
-
-#define MUTEX_INIT(a,b,c,d) \
-    do { \
-       lockinit(&(a)->lock, PSOCK, "afs rx mutex", 0, 0); \
-       (a)->owner = 0; \
-    } while(0);
-#define MUTEX_DESTROY(a) \
-    do { \
-       (a)->owner = (struct proc *)-1; \
-    } while(0);
-#define MUTEX_ENTER(a) \
-    do { \
-       lockmgr(&(a)->lock, LK_EXCLUSIVE, 0, curproc); \
-       osi_Assert((a)->owner == 0); \
-       (a)->owner = curproc; \
-    } while(0);
-#define MUTEX_TRYENTER(a) \
-    ( lockmgr(&(a)->lock, LK_EXCLUSIVE|LK_NOWAIT, 0, curproc) ? 0 : ((a)->owner = curproc, 1) )
-#define xMUTEX_TRYENTER(a) \
-    ( osi_Assert((a)->owner == 0), (a)->owner = curproc, 1)
-#define MUTEX_EXIT(a) \
-    do { \
-       osi_Assert((a)->owner == curproc); \
-       (a)->owner = 0; \
-       lockmgr(&(a)->lock, LK_RELEASE, 0, curproc); \
-    } while(0);
+    } while(0)
 
-#undef MUTEX_ISMINE
-#define MUTEX_ISMINE(a) (((afs_kmutex_t *)(a))->owner == curproc)
-#else
-typedef struct {
-    struct simplelock lock;
-    struct proc *owner;
-} afs_kmutex_t;
-
-
-#define MUTEX_INIT(a,b,c,d) \
-    do { \
-       simple_lock_init(&(a)->lock); \
-       (a)->owner = 0; \
-    } while(0);
-#define MUTEX_DESTROY(a) \
-    do { \
-       (a)->owner = (struct proc *)-1; \
-    } while(0);
-#define MUTEX_ENTER(a) \
-    do { \
-       simple_lock(&(a)->lock); \
-       osi_Assert((a)->owner == 0); \
-       (a)->owner = curproc; \
-    } while(0);
-#define MUTEX_TRYENTER(a) \
-    ( simple_lock_try(&(a)->lock) ? 0 : ((a)->owner = curproc, 1) )
-#define MUTEX_EXIT(a) \
-    do { \
-       osi_Assert((a)->owner == curproc); \
-       (a)->owner = 0; \
-       simple_unlock(&(a)->lock); \
-    } while(0);
-
-#undef MUTEX_ISMINE
-#define MUTEX_ISMINE(a) (((afs_kmutex_t *)(a))->owner == curproc)
+#define MUTEX_ASSERT(a) osi_Assert(((afs_kmutex_t *)(a))->owner == curthread)
 #endif
 
-
-#undef osirx_AssertMine
-extern void osirx_AssertMine(afs_kmutex_t * lockaddr, char *msg);
-
-
 /*
  * Condition variables
  *