Skip to content

Commit

Permalink
[PATCH] remove generic__raw_read_trylock()
Browse files Browse the repository at this point in the history
If the cpu has the lock held for write, is interrupted, and the interrupt
handler calls read_trylock(), it's an instant deadlock.

Now, Dave Miller has subsequently pointed out that we don't have any
situations where this can occur.  Nevertheless, we should delete
generic__raw_read_lock (and its associated EXPORT to make Arjan happy) so that
nobody thinks they can use it.

Acked-by: "David S. Miller" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Matthew Wilcox authored and Linus Torvalds committed Sep 29, 2006
1 parent e04da1d commit 910067d
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions kernel/spinlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@
#include <linux/debug_locks.h>
#include <linux/module.h>

/*
* Generic declaration of the raw read_trylock() function,
* architectures are supposed to optimize this:
*/
int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock)
{
__raw_read_lock(lock);
return 1;
}
EXPORT_SYMBOL(generic__raw_read_trylock);

int __lockfunc _spin_trylock(spinlock_t *lock)
{
preempt_disable();
Expand Down

0 comments on commit 910067d

Please sign in to comment.