Skip to content

Commit 70375c2

Browse files
dmatlackbonzini
authored andcommitted
Revert "KVM: set owner of cpu and vm file operations"
This reverts commit 3d3aab1. Now that the KVM module's lifetime is tied to kvm.users_count, there is no need to also tie it's lifetime to the lifetime of the VM and vCPU file descriptors. Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: David Matlack <dmatlack@google.com> Message-Id: <20220303183328.1499189-3-dmatlack@google.com> Reviewed-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 5f6de5c commit 70375c2

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

virt/kvm/kvm_main.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3676,7 +3676,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp)
36763676
return 0;
36773677
}
36783678

3679-
static struct file_operations kvm_vcpu_fops = {
3679+
static const struct file_operations kvm_vcpu_fops = {
36803680
.release = kvm_vcpu_release,
36813681
.unlocked_ioctl = kvm_vcpu_ioctl,
36823682
.mmap = kvm_vcpu_mmap,
@@ -4727,7 +4727,7 @@ static long kvm_vm_compat_ioctl(struct file *filp,
47274727
}
47284728
#endif
47294729

4730-
static struct file_operations kvm_vm_fops = {
4730+
static const struct file_operations kvm_vm_fops = {
47314731
.release = kvm_vm_release,
47324732
.unlocked_ioctl = kvm_vm_ioctl,
47334733
.llseek = noop_llseek,
@@ -5734,8 +5734,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
57345734
goto out_free_5;
57355735

57365736
kvm_chardev_ops.owner = module;
5737-
kvm_vm_fops.owner = module;
5738-
kvm_vcpu_fops.owner = module;
57395737

57405738
r = misc_register(&kvm_dev);
57415739
if (r) {

0 commit comments

Comments
 (0)