@@ -167,7 +167,7 @@ struct vcpu_dispatch_data {
167167 */
168168#define NR_CPUS_H NR_CPUS
169169
170- DEFINE_RWLOCK (dtl_access_lock );
170+ DECLARE_RWSEM (dtl_access_lock );
171171static DEFINE_PER_CPU (struct vcpu_dispatch_data , vcpu_disp_data ) ;
172172static DEFINE_PER_CPU (u64 , dtl_entry_ridx ) ;
173173static DEFINE_PER_CPU (struct dtl_worker , dtl_workers ) ;
@@ -461,7 +461,7 @@ static int dtl_worker_enable(unsigned long *time_limit)
461461{
462462 int rc = 0 , state ;
463463
464- if (!write_trylock (& dtl_access_lock )) {
464+ if (!down_write_trylock (& dtl_access_lock )) {
465465 rc = - EBUSY ;
466466 goto out ;
467467 }
@@ -477,7 +477,7 @@ static int dtl_worker_enable(unsigned long *time_limit)
477477 pr_err ("vcpudispatch_stats: unable to setup workqueue for DTL processing\n" );
478478 free_dtl_buffers (time_limit );
479479 reset_global_dtl_mask ();
480- write_unlock (& dtl_access_lock );
480+ up_write (& dtl_access_lock );
481481 rc = - EINVAL ;
482482 goto out ;
483483 }
@@ -492,7 +492,7 @@ static void dtl_worker_disable(unsigned long *time_limit)
492492 cpuhp_remove_state (dtl_worker_state );
493493 free_dtl_buffers (time_limit );
494494 reset_global_dtl_mask ();
495- write_unlock (& dtl_access_lock );
495+ up_write (& dtl_access_lock );
496496}
497497
498498static ssize_t vcpudispatch_stats_write (struct file * file , const char __user * p ,
0 commit comments