Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154810094
D24847.id71810.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
709 B
Referenced Files
None
Subscribers
None
D24847.id71810.diff
View Options
Index: sys/compat/linuxkpi/common/include/linux/mutex.h
===================================================================
--- sys/compat/linuxkpi/common/include/linux/mutex.h
+++ 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;
@@ -125,6 +126,16 @@
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
/* NOTE: the maximum WITNESS name is 64 chars */
#define __mutex_name(name, file, line) \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 30, 12:17 PM (6 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32511143
Default Alt Text
D24847.id71810.diff (709 B)
Attached To
Mode
D24847: linuxkpi: Add atomic_dec_and_mutex_lock
Attached
Detach File
Event Timeline
Log In to Comment