[PATCH REBASED 2/6] ia64: Add __down_read_killable()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: linux-ia64@xxxxxxxxxxxxxxx, avagin@xxxxxxxxxxxxx, peterz@xxxxxxxxxxxxx, heiko.carstens@xxxxxxxxxx, hpa@xxxxxxxxx, gorcunov@xxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, mingo@xxxxxxxxxx, mattst88@xxxxxxxxx, fenghua.yu@xxxxxxxxx, arnd@xxxxxxxx, ktkhai@xxxxxxxxxxxxx, ink@xxxxxxxxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, rth@xxxxxxxxxxx, tony.luck@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, schwidefsky@xxxxxxxxxx, davem@xxxxxxxxxxxxx, rientjes@xxxxxxxxxx, viro@xxxxxxxxxxxxxxxxxx
- Subject: [PATCH REBASED 2/6] ia64: Add __down_read_killable()
- From: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx>
- Date: Fri, 29 Sep 2017 19:06:07 +0300
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@xxxxxxxxxxxxx;
- In-reply-to: <150670038738.23930.7190484711222807884.stgit@localhost.localdomain>
- References: <150670038738.23930.7190484711222807884.stgit@localhost.localdomain>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
- User-agent: StGit/0.18
Similar to __down_write_killable(), and read killable primitive.
Signed-off-by: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx>
---
arch/ia64/include/asm/rwsem.h | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/arch/ia64/include/asm/rwsem.h b/arch/ia64/include/asm/rwsem.h
index 8fa98dd303b4..1fb8b7cb1c98 100644
--- a/arch/ia64/include/asm/rwsem.h
+++ b/arch/ia64/include/asm/rwsem.h
@@ -37,15 +37,31 @@
/*
* lock for reading
*/
-static inline void
-__down_read (struct rw_semaphore *sem)
+static inline int
+___down_read (struct rw_semaphore *sem)
{
long result = ia64_fetchadd8_acq((unsigned long *)&sem->count.counter, 1);
- if (result < 0)
+ return (result < 0);
+}
+
+static inline void
+__down_read (struct rw_semaphore *sem)
+{
+ if (___down_read(sem))
rwsem_down_read_failed(sem);
}
+static inline int
+__down_read_killable (struct rw_semaphore *sem)
+{
+ if (___down_read(sem))
+ if (IS_ERR(rwsem_down_read_failed_killable(sem)))
+ return -EINTR;
+
+ return 0;
+}
+
/*
* lock for writing
*/
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]