diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2013-09-04 22:32:24 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2014-06-09 13:29:03 +0100 |
commit | d244fc2319deec77099d7b4d63d8fe8830ac66ec (patch) | |
tree | d95e6d7012a0a837a5e9514a381eb00abcfcb17a /virt | |
parent | 21820c185fa08509ed2abaf4de43b56656eb038d (diff) | |
download | lwn-d244fc2319deec77099d7b4d63d8fe8830ac66ec.tar.gz lwn-d244fc2319deec77099d7b4d63d8fe8830ac66ec.zip |
kvm: remove .done from struct kvm_async_pf
commit 98fda169290b3b28c0f2db2b8f02290c13da50ef upstream.
'.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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
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 1758e32863cf..68dc92421c8d 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) spin_lock(&vcpu->async_pf.lock); list_add_tail(&apf->link, &vcpu->async_pf.done); apf->page = page; - apf->done = true; spin_unlock(&vcpu->async_pf.lock); /* @@ -99,9 +98,8 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu) struct kvm_async_pf *work = list_entry(vcpu->async_pf.queue.next, typeof(*work), queue); - cancel_work_sync(&work->work); list_del(&work->queue); - if (!work->done) { /* work was canceled */ + if (cancel_work_sync(&work->work)) { mmdrop(work->mm); kvm_put_kvm(vcpu->kvm); /* == work->vcpu->kvm */ 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, return 0; work->page = NULL; - work->done = false; work->vcpu = vcpu; work->gva = gva; work->addr = gfn_to_hva(vcpu->kvm, gfn); |