Page MenuHomeFreeBSD

D24847.diff
No OneTemporary

D24847.diff

Index: head/sys/compat/linuxkpi/common/include/linux/mutex.h
===================================================================
--- head/sys/compat/linuxkpi/common/include/linux/mutex.h
+++ head/sys/compat/linuxkpi/common/include/linux/mutex.h
@@ -37,6 +37,7 @@
#include <sys/sx.h>
#include <linux/spinlock.h>
+#include <asm/atomic.h>
typedef struct mutex {
struct sx sx;
@@ -123,6 +124,16 @@
mutex_is_owned(mutex_t *m)
{
return (sx_xlocked(&m->sx));
+}
+
+static inline int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *m)
+{
+ if (atomic_dec_and_test(cnt)) {
+ mutex_lock(m);
+ return (1);
+ }
+
+ return (0);
}
#ifdef WITNESS_ALL

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 2:45 PM (22 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14740750
Default Alt Text
D24847.diff (662 B)

Event Timeline