-#define LNET_MUTEX_LOCK(m) mutex_lock(m)
-#define LNET_MUTEX_UNLOCK(m) mutex_unlock(m)
-
-#else /* !__KERNEL__ */
-
-# ifndef HAVE_LIBPTHREAD
-#define LNET_SINGLE_THREADED_LOCK(l) \
-do { \
- LASSERT ((l) == 0); \
- (l) = 1; \
-} while (0)
-
-#define LNET_SINGLE_THREADED_UNLOCK(l) \
-do { \
- LASSERT ((l) == 1); \
- (l) = 0; \
-} while (0)
-
-#define LNET_MUTEX_LOCK(m) LNET_SINGLE_THREADED_LOCK(*(m))
-#define LNET_MUTEX_UNLOCK(m) LNET_SINGLE_THREADED_UNLOCK(*(m))
-
-#define lnet_ptl_lock(ptl) \
- LNET_SINGLE_THREADED_LOCK((ptl)->ptl_lock)
-#define lnet_ptl_unlock(ptl) \
- LNET_SINGLE_THREADED_UNLOCK((ptl)->ptl_lock)
-
-#define lnet_eq_wait_lock() \
- LNET_SINGLE_THREADED_LOCK(the_lnet.ln_eq_wait_lock)
-#define lnet_eq_wait_unlock() \
- LNET_SINGLE_THREADED_UNLOCK(the_lnet.ln_eq_wait_lock)
-
-#define lnet_ni_lock(ni) \
- LNET_SINGLE_THREADED_LOCK((ni)->ni_lock)
-#define lnet_ni_unlock(ni) \
- LNET_SINGLE_THREADED_UNLOCK((ni)->ni_lock)
-
-# else /* HAVE_LIBPTHREAD */
-
-#define LNET_MUTEX_LOCK(m) pthread_mutex_lock(m)
-#define LNET_MUTEX_UNLOCK(m) pthread_mutex_unlock(m)
-
-#define lnet_ptl_lock(ptl) pthread_mutex_lock(&(ptl)->ptl_lock)
-#define lnet_ptl_unlock(ptl) pthread_mutex_unlock(&(ptl)->ptl_lock)
-
-#define lnet_eq_wait_lock() pthread_mutex_lock(&the_lnet.ln_eq_wait_lock)
-#define lnet_eq_wait_unlock() pthread_mutex_unlock(&the_lnet.ln_eq_wait_lock)
-
-#define lnet_ni_lock(ni) pthread_mutex_lock(&(ni)->ni_lock)
-#define lnet_ni_unlock(ni) pthread_mutex_unlock(&(ni)->ni_lock)
-
-# endif /* HAVE_LIBPTHREAD */
-#endif /* __KERNEL__ */
-
-#define MAX_PORTALS 64
-
-/* these are only used by code with LNET_USE_LIB_FREELIST, but we still
- * exported them to !LNET_USE_LIB_FREELIST for easy implemetation */
-#define LNET_FL_MAX_MES 2048
-#define LNET_FL_MAX_MDS 2048
-#define LNET_FL_MAX_EQS 512
-#define LNET_FL_MAX_MSGS 2048 /* Outstanding messages */