diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2009-12-23 11:35:26 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:35:45 -0500 |
commit | 79fac95ecfa3969aab8119d37ccd7226165f933a (patch) | |
tree | 4103169c7fd2b7fb1ba95dae2db6b3f365476b9d /virt/kvm/kvm_main.c | |
parent | f656ce0185cabbbb0cf96877306879661297c7ad (diff) |
KVM: convert slots_lock to a mutex
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r-- | virt/kvm/kvm_main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 659bc12ad16a..2b7cd6c0d9ca 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -429,7 +429,7 @@ static struct kvm *kvm_create_vm(void) | |||
429 | kvm_eventfd_init(kvm); | 429 | kvm_eventfd_init(kvm); |
430 | mutex_init(&kvm->lock); | 430 | mutex_init(&kvm->lock); |
431 | mutex_init(&kvm->irq_lock); | 431 | mutex_init(&kvm->irq_lock); |
432 | init_rwsem(&kvm->slots_lock); | 432 | mutex_init(&kvm->slots_lock); |
433 | atomic_set(&kvm->users_count, 1); | 433 | atomic_set(&kvm->users_count, 1); |
434 | spin_lock(&kvm_lock); | 434 | spin_lock(&kvm_lock); |
435 | list_add(&kvm->vm_list, &vm_list); | 435 | list_add(&kvm->vm_list, &vm_list); |
@@ -763,9 +763,9 @@ int kvm_set_memory_region(struct kvm *kvm, | |||
763 | { | 763 | { |
764 | int r; | 764 | int r; |
765 | 765 | ||
766 | down_write(&kvm->slots_lock); | 766 | mutex_lock(&kvm->slots_lock); |
767 | r = __kvm_set_memory_region(kvm, mem, user_alloc); | 767 | r = __kvm_set_memory_region(kvm, mem, user_alloc); |
768 | up_write(&kvm->slots_lock); | 768 | mutex_unlock(&kvm->slots_lock); |
769 | return r; | 769 | return r; |
770 | } | 770 | } |
771 | EXPORT_SYMBOL_GPL(kvm_set_memory_region); | 771 | EXPORT_SYMBOL_GPL(kvm_set_memory_region); |
@@ -1997,7 +1997,7 @@ int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, | |||
1997 | return -EOPNOTSUPP; | 1997 | return -EOPNOTSUPP; |
1998 | } | 1998 | } |
1999 | 1999 | ||
2000 | /* Caller must have write lock on slots_lock. */ | 2000 | /* Caller must hold slots_lock. */ |
2001 | int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, | 2001 | int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, |
2002 | struct kvm_io_device *dev) | 2002 | struct kvm_io_device *dev) |
2003 | { | 2003 | { |
@@ -2019,7 +2019,7 @@ int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, | |||
2019 | return 0; | 2019 | return 0; |
2020 | } | 2020 | } |
2021 | 2021 | ||
2022 | /* Caller must have write lock on slots_lock. */ | 2022 | /* Caller must hold slots_lock. */ |
2023 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, | 2023 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, |
2024 | struct kvm_io_device *dev) | 2024 | struct kvm_io_device *dev) |
2025 | { | 2025 | { |