projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5d425c
)
introduce write_trylock_irqsave()
author
Satyam Sharma
<
[email protected]
>
Mon, 16 Jul 2007 06:39:24 +0000
(23:39 -0700)
committer
Linus Torvalds
<
[email protected]
>
Mon, 16 Jul 2007 16:05:40 +0000
(09:05 -0700)
Introduce a write_trylock_irqsave() implementation. Similar in style to
the implementation of spin_trylock_irqsave() in mainline.
Signed-off-by: Satyam Sharma <
[email protected]
>
Cc: Sripathi Kodi <
[email protected]
>
Cc: Ingo Molnar <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
include/linux/spinlock.h
patch
|
blob
|
history
diff --git
a/include/linux/spinlock.h
b/include/linux/spinlock.h
index a946176db638c7198705a20a7d2fd715279dfc2d..c376f3b36c8980c9b434cabc693e7ef9b4ab43f3 100644
(file)
--- a/
include/linux/spinlock.h
+++ b/
include/linux/spinlock.h
@@
-282,6
+282,13
@@
do { \
1 : ({ local_irq_restore(flags); 0; }); \
})
+#define write_trylock_irqsave(lock, flags) \
+({ \
+ local_irq_save(flags); \
+ write_trylock(lock) ? \
+ 1 : ({ local_irq_restore(flags); 0; }); \
+})
+
/*
* Locks two spinlocks l1 and l2.
* l1_first indicates if spinlock l1 should be taken first.