|
@@ -346,24 +346,4 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
|
|
|
(volatile typeof(x) *)&(x); })
|
|
|
#define ACCESS_ONCE(x) (*__ACCESS_ONCE(x))
|
|
|
|
|
|
-/**
|
|
|
- * lockless_dereference() - safely load a pointer for later dereference
|
|
|
- * @p: The pointer to load
|
|
|
- *
|
|
|
- * Similar to rcu_dereference(), but for situations where the pointed-to
|
|
|
- * object's lifetime is managed by something other than RCU. That
|
|
|
- * "something other" might be reference counting or simple immortality.
|
|
|
- *
|
|
|
- * The seemingly unused variable ___typecheck_p validates that @p is
|
|
|
- * indeed a pointer type by using a pointer to typeof(*p) as the type.
|
|
|
- * Taking a pointer to typeof(*p) again is needed in case p is void *.
|
|
|
- */
|
|
|
-#define lockless_dereference(p) \
|
|
|
-({ \
|
|
|
- typeof(p) _________p1 = READ_ONCE(p); \
|
|
|
- typeof(*(p)) *___typecheck_p __maybe_unused; \
|
|
|
- smp_read_barrier_depends(); /* Dependency order vs. p above. */ \
|
|
|
- (_________p1); \
|
|
|
-})
|
|
|
-
|
|
|
#endif /* __LINUX_COMPILER_H */
|