Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115797475
D46842.id143892.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D46842.id143892.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h
--- a/sys/compat/linuxkpi/common/include/linux/lockdep.h
+++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h
@@ -70,17 +70,6 @@
#define lockdep_assert_none_held_once() do { } while (0)
-static __inline bool
-lockdep_is_held(void *__m)
-{
- struct lock_object *__lock;
- struct thread *__td;
-
- __lock = __m;
- return (LOCK_CLASS(__lock)->lc_owner(__lock, &__td) != 0);
-}
-#define lockdep_is_held_type(_m, _t) lockdep_is_held(_m)
-
#else
#define lockdep_assert(cond) do { } while (0)
#define lockdep_assert_once(cond) do { } while (0)
@@ -91,10 +80,23 @@
#define lockdep_assert_held_once(m) do { (void)(m); } while (0)
-#define lockdep_is_held(m) 1
-#define lockdep_is_held_type(_m, _t) 1
#endif
+static __inline bool
+lockdep_is_held(void *__m __diagused)
+{
+#ifdef INVARIANTS
+ struct lock_object *__lock;
+ struct thread *__td;
+
+ __lock = __m;
+ return (LOCK_CLASS(__lock)->lc_owner(__lock, &__td) != 0);
+#else
+ return (1);
+#endif
+}
+#define lockdep_is_held_type(_m, _t) lockdep_is_held(_m)
+
#define might_lock(m) do { } while (0)
#define might_lock_read(m) do { } while (0)
#define might_lock_nested(m, n) do { } while (0)
diff --git a/sys/compat/linuxkpi/common/include/linux/rcupdate.h b/sys/compat/linuxkpi/common/include/linux/rcupdate.h
--- a/sys/compat/linuxkpi/common/include/linux/rcupdate.h
+++ b/sys/compat/linuxkpi/common/include/linux/rcupdate.h
@@ -28,6 +28,7 @@
#include <linux/compiler.h>
#include <linux/types.h>
+#include <linux/kernel.h>
#include <machine/atomic.h>
@@ -79,8 +80,10 @@
#define rcu_access_pointer(p) \
((__typeof(*p) *)READ_ONCE(p))
-#define rcu_dereference_protected(p, c) \
- ((__typeof(*p) *)READ_ONCE(p))
+#define rcu_dereference_protected(p, c) ({ \
+ WARN_ONCE(!(c), "rcu_dereference_protected condition failed"); \
+ ((__typeof(*p) *)READ_ONCE(p)); \
+})
#define rcu_dereference(p) \
rcu_dereference_protected(p, 0)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 29, 7:31 PM (10 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17845119
Default Alt Text
D46842.id143892.diff (1 KB)
Attached To
Mode
D46842: LinuxKPI: update rcu_dereference_*() and lockdep_is_held()
Attached
Detach File
Event Timeline
Log In to Comment