File tree Expand file tree Collapse file tree 2 files changed +21
-21
lines changed Expand file tree Collapse file tree 2 files changed +21
-21
lines changed Original file line number Diff line number Diff line change @@ -308,8 +308,27 @@ extern void lockdep_set_selftest_task(struct task_struct *task);
308
308
309
309
extern void lockdep_init_task (struct task_struct * task );
310
310
311
- extern void lockdep_off (void );
312
- extern void lockdep_on (void );
311
+ /*
312
+ * Split the recrursion counter in two to readily detect 'off' vs recursion.
313
+ */
314
+ #define LOCKDEP_RECURSION_BITS 16
315
+ #define LOCKDEP_OFF (1U << LOCKDEP_RECURSION_BITS)
316
+ #define LOCKDEP_RECURSION_MASK (LOCKDEP_OFF - 1)
317
+
318
+ /*
319
+ * lockdep_{off,on}() are macros to avoid tracing and kprobes; not inlines due
320
+ * to header dependencies.
321
+ */
322
+
323
+ #define lockdep_off () \
324
+ do { \
325
+ current->lockdep_recursion += LOCKDEP_OFF; \
326
+ } while (0)
327
+
328
+ #define lockdep_on () \
329
+ do { \
330
+ current->lockdep_recursion -= LOCKDEP_OFF; \
331
+ } while (0)
313
332
314
333
extern void lockdep_register_key (struct lock_class_key * key );
315
334
extern void lockdep_unregister_key (struct lock_class_key * key );
Original file line number Diff line number Diff line change @@ -393,25 +393,6 @@ void lockdep_init_task(struct task_struct *task)
393
393
task -> lockdep_recursion = 0 ;
394
394
}
395
395
396
- /*
397
- * Split the recrursion counter in two to readily detect 'off' vs recursion.
398
- */
399
- #define LOCKDEP_RECURSION_BITS 16
400
- #define LOCKDEP_OFF (1U << LOCKDEP_RECURSION_BITS)
401
- #define LOCKDEP_RECURSION_MASK (LOCKDEP_OFF - 1)
402
-
403
- void lockdep_off (void )
404
- {
405
- current -> lockdep_recursion += LOCKDEP_OFF ;
406
- }
407
- EXPORT_SYMBOL (lockdep_off );
408
-
409
- void lockdep_on (void )
410
- {
411
- current -> lockdep_recursion -= LOCKDEP_OFF ;
412
- }
413
- EXPORT_SYMBOL (lockdep_on );
414
-
415
396
static inline void lockdep_recursion_finish (void )
416
397
{
417
398
if (WARN_ON_ONCE (-- current -> lockdep_recursion ))
You can’t perform that action at this time.
0 commit comments