summaryrefslogtreecommitdiffstats
path: root/sys/gnu/fs
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2006-06-11 00:54:35 +0000
committerrodrigc <rodrigc@FreeBSD.org>2006-06-11 00:54:35 +0000
commit3afdadc9afc2ef44469c17d76f116063a5c9e9d3 (patch)
tree78e2e27f49f70601c9b68e7de3b59831f1dc8d0a /sys/gnu/fs
parent0d503addbcdae1489a08b02e73ee4879e2ff366b (diff)
downloadFreeBSD-src-3afdadc9afc2ef44469c17d76f116063a5c9e9d3.zip
FreeBSD-src-3afdadc9afc2ef44469c17d76f116063a5c9e9d3.tar.gz
Restore changes to spinlock macros before merge.
Diffstat (limited to 'sys/gnu/fs')
-rw-r--r--sys/gnu/fs/xfs/FreeBSD/support/spin.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/gnu/fs/xfs/FreeBSD/support/spin.h b/sys/gnu/fs/xfs/FreeBSD/support/spin.h
index 717c13c..2b09be4 100644
--- a/sys/gnu/fs/xfs/FreeBSD/support/spin.h
+++ b/sys/gnu/fs/xfs/FreeBSD/support/spin.h
@@ -11,8 +11,7 @@
/*
* Map the spinlocks from IRIX to FreeBSD
*/
-/* These spin locks should map to mutex_spin locks? */
-#define spinlock_init(lock, name) mtx_init(lock, name, NULL, /*MTX_SPIN*/ MTX_DEF)
+#define spinlock_init(lock, name) mtx_init(lock, name, NULL, MTX_DEF)
#define spinlock_destroy(lock) mtx_destroy(lock)
/*
@@ -24,21 +23,20 @@ typedef struct mtx lock_t;
#define nested_spinlock(lock) mtx_lock(lock)
#define nested_spintrylock(lock) mtx_trylock(lock)
-#define spin_lock(lock) mtx_lock_spin(lock)
-#define spin_unlock(lock) mtx_unlock_spin(lock)
+#define spin_lock(lock) mtx_lock(lock)
+#define spin_unlock(lock) mtx_unlock(lock)
-#if 0
#if LOCK_DEBUG > 0
#define mutex_spinlock(lock) (spin_lock(lock),0)
#else
static __inline register_t
mutex_spinlock(lock_t *lock) { mtx_lock(lock); return 0; }
#endif
-#endif
-#define mutex_spinlock(lock) (mtx_lock(lock),0)
-#define mutex_spinunlock(lock,s) mtx_unlock(lock)
-//#define mutex_spinlock(lock) (mtx_lock_spin(lock),0)
-//#define mutex_spinunlock(lock,s) mtx_unlock_spin(lock)
+#define mutex_spinunlock(lock,s) \
+ do { \
+ spin_unlock(lock); \
+ if (&s) {} \
+ } while (0)
#endif /* __XFS_SUPPORT_SPIN_H__ */
OpenPOWER on IntegriCloud