@@ -170,7 +170,7 @@ struct vcpu_dispatch_data {
170
170
*/
171
171
#define NR_CPUS_H NR_CPUS
172
172
173
- DEFINE_RWLOCK (dtl_access_lock );
173
+ DECLARE_RWSEM (dtl_access_lock );
174
174
static DEFINE_PER_CPU (struct vcpu_dispatch_data , vcpu_disp_data ) ;
175
175
static DEFINE_PER_CPU (u64 , dtl_entry_ridx ) ;
176
176
static DEFINE_PER_CPU (struct dtl_worker , dtl_workers ) ;
@@ -464,7 +464,7 @@ static int dtl_worker_enable(unsigned long *time_limit)
464
464
{
465
465
int rc = 0 , state ;
466
466
467
- if (!write_trylock (& dtl_access_lock )) {
467
+ if (!down_write_trylock (& dtl_access_lock )) {
468
468
rc = - EBUSY ;
469
469
goto out ;
470
470
}
@@ -480,7 +480,7 @@ static int dtl_worker_enable(unsigned long *time_limit)
480
480
pr_err ("vcpudispatch_stats: unable to setup workqueue for DTL processing\n" );
481
481
free_dtl_buffers (time_limit );
482
482
reset_global_dtl_mask ();
483
- write_unlock (& dtl_access_lock );
483
+ up_write (& dtl_access_lock );
484
484
rc = - EINVAL ;
485
485
goto out ;
486
486
}
@@ -495,7 +495,7 @@ static void dtl_worker_disable(unsigned long *time_limit)
495
495
cpuhp_remove_state (dtl_worker_state );
496
496
free_dtl_buffers (time_limit );
497
497
reset_global_dtl_mask ();
498
- write_unlock (& dtl_access_lock );
498
+ up_write (& dtl_access_lock );
499
499
}
500
500
501
501
static ssize_t vcpudispatch_stats_write (struct file * file , const char __user * p ,
0 commit comments