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