| .. | .. |
|---|
| 29 | 29 | extern int __percpu_down_read(struct percpu_rw_semaphore *, int); |
|---|
| 30 | 30 | extern void __percpu_up_read(struct percpu_rw_semaphore *); |
|---|
| 31 | 31 | |
|---|
| 32 | | -static inline void percpu_down_read_preempt_disable(struct percpu_rw_semaphore *sem) |
|---|
| 32 | +static inline void percpu_down_read(struct percpu_rw_semaphore *sem) |
|---|
| 33 | 33 | { |
|---|
| 34 | 34 | might_sleep(); |
|---|
| 35 | 35 | |
|---|
| .. | .. |
|---|
| 47 | 47 | __this_cpu_inc(*sem->read_count); |
|---|
| 48 | 48 | if (unlikely(!rcu_sync_is_idle(&sem->rss))) |
|---|
| 49 | 49 | __percpu_down_read(sem, false); /* Unconditional memory barrier */ |
|---|
| 50 | | - barrier(); |
|---|
| 51 | 50 | /* |
|---|
| 52 | | - * The barrier() prevents the compiler from |
|---|
| 51 | + * The preempt_enable() prevents the compiler from |
|---|
| 53 | 52 | * bleeding the critical section out. |
|---|
| 54 | 53 | */ |
|---|
| 55 | | -} |
|---|
| 56 | | - |
|---|
| 57 | | -static inline void percpu_down_read(struct percpu_rw_semaphore *sem) |
|---|
| 58 | | -{ |
|---|
| 59 | | - percpu_down_read_preempt_disable(sem); |
|---|
| 60 | 54 | preempt_enable(); |
|---|
| 61 | 55 | } |
|---|
| 62 | 56 | |
|---|
| .. | .. |
|---|
| 83 | 77 | return ret; |
|---|
| 84 | 78 | } |
|---|
| 85 | 79 | |
|---|
| 86 | | -static inline void percpu_up_read_preempt_enable(struct percpu_rw_semaphore *sem) |
|---|
| 80 | +static inline void percpu_up_read(struct percpu_rw_semaphore *sem) |
|---|
| 87 | 81 | { |
|---|
| 88 | | - /* |
|---|
| 89 | | - * The barrier() prevents the compiler from |
|---|
| 90 | | - * bleeding the critical section out. |
|---|
| 91 | | - */ |
|---|
| 92 | | - barrier(); |
|---|
| 82 | + preempt_disable(); |
|---|
| 93 | 83 | /* |
|---|
| 94 | 84 | * Same as in percpu_down_read(). |
|---|
| 95 | 85 | */ |
|---|
| .. | .. |
|---|
| 100 | 90 | preempt_enable(); |
|---|
| 101 | 91 | |
|---|
| 102 | 92 | rwsem_release(&sem->rw_sem.dep_map, 1, _RET_IP_); |
|---|
| 103 | | -} |
|---|
| 104 | | - |
|---|
| 105 | | -static inline void percpu_up_read(struct percpu_rw_semaphore *sem) |
|---|
| 106 | | -{ |
|---|
| 107 | | - preempt_disable(); |
|---|
| 108 | | - percpu_up_read_preempt_enable(sem); |
|---|
| 109 | 93 | } |
|---|
| 110 | 94 | |
|---|
| 111 | 95 | extern void percpu_down_write(struct percpu_rw_semaphore *); |
|---|