projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git]
/
include
/
asm-generic
/
rwsem.h
diff --git
a/include/asm-generic/rwsem.h
b/include/asm-generic/rwsem.h
index
3fc94a0
..
5be122e
100644
(file)
--- a/
include/asm-generic/rwsem.h
+++ b/
include/asm-generic/rwsem.h
@@
-41,8
+41,8
@@
static inline int __down_read_trylock(struct rw_semaphore *sem)
{
long tmp;
{
long tmp;
- while ((tmp =
sem->count
) >= 0) {
- if (tmp == cmpxchg_acquire(&sem->count, tmp,
+ while ((tmp =
atomic_long_read(&sem->count)
) >= 0) {
+ if (tmp ==
atomic_long_
cmpxchg_acquire(&sem->count, tmp,
tmp + RWSEM_ACTIVE_READ_BIAS)) {
return 1;
}
tmp + RWSEM_ACTIVE_READ_BIAS)) {
return 1;
}
@@
-79,7
+79,7
@@
static inline int __down_write_trylock(struct rw_semaphore *sem)
{
long tmp;
{
long tmp;
- tmp = cmpxchg_acquire(&sem->count, RWSEM_UNLOCKED_VALUE,
+ tmp =
atomic_long_
cmpxchg_acquire(&sem->count, RWSEM_UNLOCKED_VALUE,
RWSEM_ACTIVE_WRITE_BIAS);
return tmp == RWSEM_UNLOCKED_VALUE;
}
RWSEM_ACTIVE_WRITE_BIAS);
return tmp == RWSEM_UNLOCKED_VALUE;
}
@@
-106,14
+106,6
@@
static inline void __up_write(struct rw_semaphore *sem)
rwsem_wake(sem);
}
rwsem_wake(sem);
}
-/*
- * implement atomic add functionality
- */
-static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
-{
- atomic_long_add(delta, (atomic_long_t *)&sem->count);
-}
-
/*
* downgrade write lock to read lock
*/
/*
* downgrade write lock to read lock
*/
@@
-134,13
+126,5
@@
static inline void __downgrade_write(struct rw_semaphore *sem)
rwsem_downgrade_wake(sem);
}
rwsem_downgrade_wake(sem);
}
-/*
- * implement exchange and add functionality
- */
-static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
-{
- return atomic_long_add_return(delta, (atomic_long_t *)&sem->count);
-}
-
#endif /* __KERNEL__ */
#endif /* _ASM_GENERIC_RWSEM_H */
#endif /* __KERNEL__ */
#endif /* _ASM_GENERIC_RWSEM_H */