diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2013-09-04 16:32:24 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-09-24 13:12:12 -0400 |
commit | 98fda169290b3b28c0f2db2b8f02290c13da50ef (patch) | |
tree | d7726c9b6603b7e721308e36a6ff38980a170b47 /virt | |
parent | 519192aaae38e24d6b32d3d55d791fe294981185 (diff) |
kvm: remove .done from struct kvm_async_pf
'.done' is used to mark the completion of 'async_pf_execute()', but
'cancel_work_sync()' returns true when the work was canceled, so we
use it instead.
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/async_pf.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/virt/kvm/async_pf.c b/virt/kvm/async_pf.c index 8a39dda7a325..b197950ac4d5 100644 --- a/virt/kvm/async_pf.c +++ b/virt/kvm/async_pf.c | |||
@@ -75,7 +75,6 @@ static void async_pf_execute(struct work_struct *work) | |||
75 | spin_lock(&vcpu->async_pf.lock); | 75 | spin_lock(&vcpu->async_pf.lock); |
76 | list_add_tail(&apf->link, &vcpu->async_pf.done); | 76 | list_add_tail(&apf->link, &vcpu->async_pf.done); |
77 | apf->page = page; | 77 | apf->page = page; |
78 | apf->done = true; | ||
79 | spin_unlock(&vcpu->async_pf.lock); | 78 | spin_unlock(&vcpu->async_pf.lock); |
80 | 79 | ||
81 | /* | 80 | /* |
@@ -99,9 +98,8 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu) | |||
99 | struct kvm_async_pf *work = | 98 | struct kvm_async_pf *work = |
100 | list_entry(vcpu->async_pf.queue.next, | 99 | list_entry(vcpu->async_pf.queue.next, |
101 | typeof(*work), queue); | 100 | typeof(*work), queue); |
102 | cancel_work_sync(&work->work); | ||
103 | list_del(&work->queue); | 101 | list_del(&work->queue); |
104 | if (!work->done) { /* work was canceled */ | 102 | if (cancel_work_sync(&work->work)) { |
105 | mmdrop(work->mm); | 103 | mmdrop(work->mm); |
106 | kvm_put_kvm(vcpu->kvm); /* == work->vcpu->kvm */ | 104 | kvm_put_kvm(vcpu->kvm); /* == work->vcpu->kvm */ |
107 | kmem_cache_free(async_pf_cache, work); | 105 | kmem_cache_free(async_pf_cache, work); |
@@ -166,7 +164,6 @@ int kvm_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn, | |||
166 | return 0; | 164 | return 0; |
167 | 165 | ||
168 | work->page = NULL; | 166 | work->page = NULL; |
169 | work->done = false; | ||
170 | work->vcpu = vcpu; | 167 | work->vcpu = vcpu; |
171 | work->gva = gva; | 168 | work->gva = gva; |
172 | work->addr = gfn_to_hva(vcpu->kvm, gfn); | 169 | work->addr = gfn_to_hva(vcpu->kvm, gfn); |