@@ -170,7 +170,7 @@ struct vcpu_dispatch_data {
170170 */
171171#define NR_CPUS_H NR_CPUS
172172
173- DEFINE_RWLOCK (dtl_access_lock );
173+ DECLARE_RWSEM (dtl_access_lock );
174174static DEFINE_PER_CPU (struct vcpu_dispatch_data , vcpu_disp_data ) ;
175175static DEFINE_PER_CPU (u64 , dtl_entry_ridx ) ;
176176static DEFINE_PER_CPU (struct dtl_worker , dtl_workers ) ;
@@ -464,7 +464,7 @@ static int dtl_worker_enable(unsigned long *time_limit)
464464{
465465 int rc = 0 , state ;
466466
467- if (!write_trylock (& dtl_access_lock )) {
467+ if (!down_write_trylock (& dtl_access_lock )) {
468468 rc = - EBUSY ;
469469 goto out ;
470470 }
@@ -480,7 +480,7 @@ static int dtl_worker_enable(unsigned long *time_limit)
480480 pr_err ("vcpudispatch_stats: unable to setup workqueue for DTL processing\n" );
481481 free_dtl_buffers (time_limit );
482482 reset_global_dtl_mask ();
483- write_unlock (& dtl_access_lock );
483+ up_write (& dtl_access_lock );
484484 rc = - EINVAL ;
485485 goto out ;
486486 }
@@ -495,7 +495,7 @@ static void dtl_worker_disable(unsigned long *time_limit)
495495 cpuhp_remove_state (dtl_worker_state );
496496 free_dtl_buffers (time_limit );
497497 reset_global_dtl_mask ();
498- write_unlock (& dtl_access_lock );
498+ up_write (& dtl_access_lock );
499499}
500500
501501static ssize_t vcpudispatch_stats_write (struct file * file , const char __user * p ,
0 commit comments