Merge branch 'linus' into locking/core, to resolve conflicts
[linux-2.6-microblaze.git] / arch / s390 / include / asm / rwsem.h
index f731b7b..3f41987 100644 (file)
@@ -50,7 +50,7 @@
 /*
  * lock for reading
  */
-static inline void __down_read(struct rw_semaphore *sem)
+static inline int ___down_read(struct rw_semaphore *sem)
 {
        signed long old, new;
 
@@ -63,10 +63,25 @@ static inline void __down_read(struct rw_semaphore *sem)
                : "=&d" (old), "=&d" (new), "=Q" (sem->count)
                : "Q" (sem->count), "i" (RWSEM_ACTIVE_READ_BIAS)
                : "cc", "memory");
-       if (old < 0)
+       return (old < 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;
+}
+
 /*
  * trylock for reading -- returns 1 if successful, 0 if contention
  */