rwsem: use cmpxchg for trying to steal write lock
authorMichel Lespinasse <walken@google.com>
Tue, 7 May 2013 13:45:55 +0000 (06:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 May 2013 14:20:16 +0000 (07:20 -0700)
commit5ede972df1cd9294c82e9515949fd2103be81d7b
tree2c6df4c16fbe4430ea2723f2aec284105aab08db
parented00f64346631dff035adfb9b0240daaa8b46c4e
rwsem: use cmpxchg for trying to steal write lock

Using rwsem_atomic_update to try stealing the write lock forced us to
undo the adjustment in the failure path.  We can have simpler and faster
code by using cmpxchg instead.

Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/rwsem.c