Repository navigation
Commit f831948
locking/lockdep: Provide a type check for lock_is_held
Christoph requested lockdep_assert_held() variants that distinguish
between held-for-read or held-for-write.
Provide:
int lock_is_held_type(struct lockdep_map *lock, int read)
which takes the same argument as lock_acquire(.read) and matches it to
the held_lock instance.
Use of this function should be gated by the debug_locks variable. When
that is 0 the return value of the lock_is_held_type() function is
undefined. This is done to allow both negative and positive tests for
holding locks.
By default we provide (positive) lockdep_assert_held{,_exclusive,_read}()
macros.
Requested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Jens Axboe <axboe@fb.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>1 parent 3816199 commit f831948
2 files changed
Lines changed: 35 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
342 | 350 | | |
343 | | - | |
| 351 | + | |
| 352 | + | |
344 | 353 | | |
345 | 354 | | |
346 | 355 | | |
| |||
372 | 381 | | |
373 | 382 | | |
374 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
375 | 392 | | |
376 | 393 | | |
377 | 394 | | |
| |||
428 | 445 | | |
429 | 446 | | |
430 | 447 | | |
| 448 | + | |
| 449 | + | |
431 | 450 | | |
| 451 | + | |
| 452 | + | |
432 | 453 | | |
433 | 454 | | |
434 | 455 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3188 | 3188 | | |
3189 | 3189 | | |
3190 | 3190 | | |
3191 | | - | |
| 3191 | + | |
3192 | 3192 | | |
3193 | 3193 | | |
3194 | 3194 | | |
| |||
3329 | 3329 | | |
3330 | 3330 | | |
3331 | 3331 | | |
3332 | | - | |
| 3332 | + | |
3333 | 3333 | | |
3334 | 3334 | | |
3335 | 3335 | | |
| |||
3576 | 3576 | | |
3577 | 3577 | | |
3578 | 3578 | | |
3579 | | - | |
| 3579 | + | |
3580 | 3580 | | |
3581 | 3581 | | |
3582 | 3582 | | |
3583 | 3583 | | |
3584 | 3584 | | |
3585 | 3585 | | |
3586 | 3586 | | |
3587 | | - | |
3588 | | - | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
| 3592 | + | |
3589 | 3593 | | |
3590 | 3594 | | |
3591 | 3595 | | |
| |||
3769 | 3773 | | |
3770 | 3774 | | |
3771 | 3775 | | |
3772 | | - | |
| 3776 | + | |
3773 | 3777 | | |
3774 | 3778 | | |
3775 | 3779 | | |
| |||
3781 | 3785 | | |
3782 | 3786 | | |
3783 | 3787 | | |
3784 | | - | |
| 3788 | + | |
3785 | 3789 | | |
3786 | 3790 | | |
3787 | 3791 | | |
3788 | 3792 | | |
3789 | 3793 | | |
3790 | | - | |
| 3794 | + | |
3791 | 3795 | | |
3792 | 3796 | | |
3793 | 3797 | | |
| |||
0 commit comments