File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ is_static struct percpu_rw_semaphore name = { \
4141#define DEFINE_STATIC_PERCPU_RWSEM (name ) \
4242 __DEFINE_PERCPU_RWSEM(name, static)
4343
44- extern int __percpu_down_read (struct percpu_rw_semaphore * , int );
44+ extern bool __percpu_down_read (struct percpu_rw_semaphore * , bool );
4545extern void __percpu_up_read (struct percpu_rw_semaphore * );
4646
4747static inline void percpu_down_read (struct percpu_rw_semaphore * sem )
@@ -69,9 +69,9 @@ static inline void percpu_down_read(struct percpu_rw_semaphore *sem)
6969 preempt_enable ();
7070}
7171
72- static inline int percpu_down_read_trylock (struct percpu_rw_semaphore * sem )
72+ static inline bool percpu_down_read_trylock (struct percpu_rw_semaphore * sem )
7373{
74- int ret = 1 ;
74+ bool ret = true ;
7575
7676 preempt_disable ();
7777 /*
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ void percpu_free_rwsem(struct percpu_rw_semaphore *sem)
4545}
4646EXPORT_SYMBOL_GPL (percpu_free_rwsem );
4747
48- int __percpu_down_read (struct percpu_rw_semaphore * sem , int try )
48+ bool __percpu_down_read (struct percpu_rw_semaphore * sem , bool try )
4949{
5050 /*
5151 * Due to having preemption disabled the decrement happens on
@@ -69,7 +69,7 @@ int __percpu_down_read(struct percpu_rw_semaphore *sem, int try)
6969 * release in percpu_up_write().
7070 */
7171 if (likely (!smp_load_acquire (& sem -> readers_block )))
72- return 1 ;
72+ return true ;
7373
7474 /*
7575 * Per the above comment; we still have preemption disabled and
@@ -78,7 +78,7 @@ int __percpu_down_read(struct percpu_rw_semaphore *sem, int try)
7878 __percpu_up_read (sem );
7979
8080 if (try )
81- return 0 ;
81+ return false ;
8282
8383 /*
8484 * We either call schedule() in the wait, or we'll fall through
@@ -94,7 +94,7 @@ int __percpu_down_read(struct percpu_rw_semaphore *sem, int try)
9494 __up_read (& sem -> rw_sem );
9595
9696 preempt_disable ();
97- return 1 ;
97+ return true ;
9898}
9999EXPORT_SYMBOL_GPL (__percpu_down_read );
100100
You can’t perform that action at this time.
0 commit comments