aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2011-03-09 02:41:59 -0500
committerAvi Kivity <avi@redhat.com>2011-05-11 07:56:53 -0400
commit0ee8dcb87e403397e575674d0e79272b06dea12e (patch)
tree64fe3a441b259105ae4f38cbf4e7e3c9e204b9bd /include/linux/kvm_host.h
parent9f381a61f58bb6487c93ce2233bb9992f8ea9211 (diff)
KVM: cleanup memslot_id function
We can get memslot id from memslot->id directly Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r--include/linux/kvm_host.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index ab428552af8e..57d7092d7717 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -365,7 +365,6 @@ pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault,
365 bool *writable); 365 bool *writable);
366pfn_t gfn_to_pfn_memslot(struct kvm *kvm, 366pfn_t gfn_to_pfn_memslot(struct kvm *kvm,
367 struct kvm_memory_slot *slot, gfn_t gfn); 367 struct kvm_memory_slot *slot, gfn_t gfn);
368int memslot_id(struct kvm *kvm, gfn_t gfn);
369void kvm_release_pfn_dirty(pfn_t); 368void kvm_release_pfn_dirty(pfn_t);
370void kvm_release_pfn_clean(pfn_t pfn); 369void kvm_release_pfn_clean(pfn_t pfn);
371void kvm_set_pfn_dirty(pfn_t pfn); 370void kvm_set_pfn_dirty(pfn_t pfn);
@@ -597,6 +596,11 @@ static inline void kvm_guest_exit(void)
597 current->flags &= ~PF_VCPU; 596 current->flags &= ~PF_VCPU;
598} 597}
599 598
599static inline int memslot_id(struct kvm *kvm, gfn_t gfn)
600{
601 return gfn_to_memslot(kvm, gfn)->id;
602}
603
600static inline unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, 604static inline unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot,
601 gfn_t gfn) 605 gfn_t gfn)
602{ 606{