File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 21
21
#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
22
22
#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
23
23
24
- static inline void __down_read (struct rw_semaphore * sem )
24
+ static inline int ___down_read (struct rw_semaphore * sem )
25
25
{
26
26
long oldcount ;
27
27
#ifndef CONFIG_SMP
@@ -41,10 +41,24 @@ static inline void __down_read(struct rw_semaphore *sem)
41
41
:"=&r" (oldcount ), "=m" (sem -> count ), "=&r" (temp )
42
42
:"Ir" (RWSEM_ACTIVE_READ_BIAS ), "m" (sem -> count ) : "memory" );
43
43
#endif
44
- if (unlikely (oldcount < 0 ))
44
+ return (oldcount < 0 );
45
+ }
46
+
47
+ static inline void __down_read (struct rw_semaphore * sem )
48
+ {
49
+ if (unlikely (___down_read (sem )))
45
50
rwsem_down_read_failed (sem );
46
51
}
47
52
53
+ static inline int __down_read_killable (struct rw_semaphore * sem )
54
+ {
55
+ if (unlikely (___down_read (sem )))
56
+ if (IS_ERR (rwsem_down_read_failed_killable (sem )))
57
+ return - EINTR ;
58
+
59
+ return 0 ;
60
+ }
61
+
48
62
/*
49
63
* trylock for reading -- returns 1 if successful, 0 if contention
50
64
*/
@@ -94,9 +108,10 @@ static inline void __down_write(struct rw_semaphore *sem)
94
108
95
109
static inline int __down_write_killable (struct rw_semaphore * sem )
96
110
{
97
- if (unlikely (___down_write (sem )))
111
+ if (unlikely (___down_write (sem ))) {
98
112
if (IS_ERR (rwsem_down_write_failed_killable (sem )))
99
113
return - EINTR ;
114
+ }
100
115
101
116
return 0 ;
102
117
}
You can’t perform that action at this time.
0 commit comments