summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-08-02 15:07:11 -0400
committerBrian Behlendorf <[email protected]>2017-08-02 15:08:02 -0400
commit549423c0d4b8176110283a5cf90c6393b2a537d4 (patch)
tree4bc9b5ce7faedc9f8d49bfe905f562bdd9d59de7 /include
parentd89616fda88bc030aaff758d37ede7d35e58841a (diff)
Revert "Remove misguided HAVE_MUTEX_OWNER check"
This reverts commit d89616fda88bc030aaff758d37ede7d35e58841a which introduced some build failures which need to be resolved before this can be merged. Signed-off-by: Brian Behlendorf <[email protected]> Issue #633
Diffstat (limited to 'include')
-rw-r--r--include/sys/mutex.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/sys/mutex.h b/include/sys/mutex.h
index d6bd99b4c..319235223 100644
--- a/include/sys/mutex.h
+++ b/include/sys/mutex.h
@@ -40,8 +40,10 @@ typedef enum {
typedef struct {
struct mutex m_mutex;
spinlock_t m_lock; /* used for serializing mutex_exit */
+#ifndef HAVE_MUTEX_OWNER
/* only when kernel doesn't have owner */
kthread_t *m_owner;
+#endif
#ifdef CONFIG_LOCKDEP
kmutex_type_t m_type;
#endif /* CONFIG_LOCKDEP */
@@ -56,16 +58,24 @@ spl_mutex_set_owner(kmutex_t *mp)
* kernel will handle its owner, so we don't need to do anything if it
* is defined.
*/
+#ifndef HAVE_MUTEX_OWNER
mp->m_owner = current;
+#endif
}
static inline void
spl_mutex_clear_owner(kmutex_t *mp)
{
+#ifndef HAVE_MUTEX_OWNER
mp->m_owner = NULL;
+#endif
}
+#ifdef HAVE_MUTEX_OWNER
#define mutex_owner(mp) (ACCESS_ONCE(MUTEX(mp)->owner))
+#else
+#define mutex_owner(mp) (ACCESS_ONCE((mp)->m_owner))
+#endif
#define mutex_owned(mp) (mutex_owner(mp) == current)
#define MUTEX_HELD(mp) mutex_owned(mp)
#define MUTEX_NOT_HELD(mp) (!MUTEX_HELD(mp))