Cleanup the LinuxKPI mutex wrappers.
authorhselasky <hselasky@FreeBSD.org>
Thu, 9 Mar 2017 17:01:00 +0000 (17:01 +0000)
committerhselasky <hselasky@FreeBSD.org>
Thu, 9 Mar 2017 17:01:00 +0000 (17:01 +0000)
commite4190cd84c4b4dfe3eb49320e5bf24fde8cd421f
tree2c8281a05ad8a2d1f04866465fa44c2b47916403
parent9252ae8d16fb46087cce6df5ecaaf1205e9d26e4
Cleanup the LinuxKPI mutex wrappers.

Add support for using mutexes during KDB and shutdown. This is also
required for doing mode-switching during panic for drm-next.

Add new mutex functions mutex_init_witness() and mutex_destroy()
allowing LinuxKPI mutexes to be tracked by witness.

Declare mutex_is_locked() and mutex_is_owned() like inline functions
to get cleaner warnings. These functions are used inside WARN_ON()
statements which might look a bit odd if these functions get fully
expanded.

Give mutexes better debug names through the mutex_name() macro when
WITNESS_ALL is defined. The mutex_name() macro can prefix parts of the
filename and line number before the mutex name.

MFC after: 1 week
Sponsored by: Mellanox Technologies
sys/compat/linuxkpi/common/include/linux/mutex.h