aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/srcu.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/srcu.h')
-rw-r--r--include/linux/srcu.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 91494d7e8e41..67135d4a8a30 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -170,6 +170,11 @@ static inline int srcu_read_lock_held(const struct srcu_struct *sp)
170#define srcu_dereference(p, sp) srcu_dereference_check((p), (sp), 0) 170#define srcu_dereference(p, sp) srcu_dereference_check((p), (sp), 0)
171 171
172/** 172/**
173 * srcu_dereference_notrace - no tracing and no lockdep calls from here
174 */
175#define srcu_dereference_notrace(p, sp) srcu_dereference_check((p), (sp), 1)
176
177/**
173 * srcu_read_lock - register a new reader for an SRCU-protected structure. 178 * srcu_read_lock - register a new reader for an SRCU-protected structure.
174 * @sp: srcu_struct in which to register the new reader. 179 * @sp: srcu_struct in which to register the new reader.
175 * 180 *
@@ -195,6 +200,16 @@ static inline int srcu_read_lock(struct srcu_struct *sp) __acquires(sp)
195 return retval; 200 return retval;
196} 201}
197 202
203/* Used by tracing, cannot be traced and cannot invoke lockdep. */
204static inline notrace int
205srcu_read_lock_notrace(struct srcu_struct *sp) __acquires(sp)
206{
207 int retval;
208
209 retval = __srcu_read_lock(sp);
210 return retval;
211}
212
198/** 213/**
199 * srcu_read_unlock - unregister a old reader from an SRCU-protected structure. 214 * srcu_read_unlock - unregister a old reader from an SRCU-protected structure.
200 * @sp: srcu_struct in which to unregister the old reader. 215 * @sp: srcu_struct in which to unregister the old reader.
@@ -209,6 +224,13 @@ static inline void srcu_read_unlock(struct srcu_struct *sp, int idx)
209 __srcu_read_unlock(sp, idx); 224 __srcu_read_unlock(sp, idx);
210} 225}
211 226
227/* Used by tracing, cannot be traced and cannot call lockdep. */
228static inline notrace void
229srcu_read_unlock_notrace(struct srcu_struct *sp, int idx) __releases(sp)
230{
231 __srcu_read_unlock(sp, idx);
232}
233
212/** 234/**
213 * smp_mb__after_srcu_read_unlock - ensure full ordering after srcu_read_unlock 235 * smp_mb__after_srcu_read_unlock - ensure full ordering after srcu_read_unlock
214 * 236 *