So that external users like vfio can call it without introducing symbol-level dependency. Signed-off-by: Jike Song <jike.song@xxxxxxxxx> --- include/linux/kvm_host.h | 5 ++++- virt/kvm/kvm_main.c | 6 ------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 01c0b9c..e1e877af 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -526,7 +526,10 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, struct module *module); void kvm_exit(void); -void kvm_get_kvm(struct kvm *kvm); +static inline void kvm_get_kvm(struct kvm *kvm) +{ + atomic_inc(&kvm->users_count); +} void kvm_put_kvm(struct kvm *kvm); static inline struct kvm_memslots *__kvm_memslots(struct kvm *kvm, int as_id) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 348d6fd..e25359b 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -740,12 +740,6 @@ static void kvm_destroy_vm(struct kvm *kvm) mmdrop(mm); } -void kvm_get_kvm(struct kvm *kvm) -{ - atomic_inc(&kvm->users_count); -} -EXPORT_SYMBOL_GPL(kvm_get_kvm); - void kvm_put_kvm(struct kvm *kvm) { if (atomic_dec_and_test(&kvm->users_count)) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html