@@ -169,7 +169,7 @@ struct vcpu_dispatch_data {
169169 */
170170#define NR_CPUS_H NR_CPUS
171171
172- DEFINE_RWLOCK (dtl_access_lock );
172+ DECLARE_RWSEM (dtl_access_lock );
173173static DEFINE_PER_CPU (struct vcpu_dispatch_data , vcpu_disp_data ) ;
174174static DEFINE_PER_CPU (u64 , dtl_entry_ridx ) ;
175175static DEFINE_PER_CPU (struct dtl_worker , dtl_workers ) ;
@@ -463,7 +463,7 @@ static int dtl_worker_enable(unsigned long *time_limit)
463463{
464464 int rc = 0 , state ;
465465
466- if (!write_trylock (& dtl_access_lock )) {
466+ if (!down_write_trylock (& dtl_access_lock )) {
467467 rc = - EBUSY ;
468468 goto out ;
469469 }
@@ -479,7 +479,7 @@ static int dtl_worker_enable(unsigned long *time_limit)
479479 pr_err ("vcpudispatch_stats: unable to setup workqueue for DTL processing\n" );
480480 free_dtl_buffers (time_limit );
481481 reset_global_dtl_mask ();
482- write_unlock (& dtl_access_lock );
482+ up_write (& dtl_access_lock );
483483 rc = - EINVAL ;
484484 goto out ;
485485 }
@@ -494,7 +494,7 @@ static void dtl_worker_disable(unsigned long *time_limit)
494494 cpuhp_remove_state (dtl_worker_state );
495495 free_dtl_buffers (time_limit );
496496 reset_global_dtl_mask ();
497- write_unlock (& dtl_access_lock );
497+ up_write (& dtl_access_lock );
498498}
499499
500500static ssize_t vcpudispatch_stats_write (struct file * file , const char __user * p ,
0 commit comments