aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/p2m.c
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-03-27 09:52:44 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-04-17 13:27:28 -0400
commitb960d6c43a63ebd2d8518b328da3816b833ee8cc (patch)
tree52ea6882e9b0c0fb3be12d348e730065f5b609d1 /arch/x86/xen/p2m.c
parente8e937be971d706061dc56220ff3605ab77622a7 (diff)
xen/p2m: m2p_find_override: use list_for_each_entry_safe
Use list_for_each_entry_safe and remove the spin_lock acquisition in m2p_find_override. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/xen/p2m.c')
-rw-r--r--arch/x86/xen/p2m.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 1b267e75158d..7ed8cc3434c5 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -809,21 +809,17 @@ struct page *m2p_find_override(unsigned long mfn)
809{ 809{
810 unsigned long flags; 810 unsigned long flags;
811 struct list_head *bucket = &m2p_overrides[mfn_hash(mfn)]; 811 struct list_head *bucket = &m2p_overrides[mfn_hash(mfn)];
812 struct page *p, *ret; 812 struct page *p, *t, *ret;
813 813
814 ret = NULL; 814 ret = NULL;
815 815
816 spin_lock_irqsave(&m2p_override_lock, flags); 816 list_for_each_entry_safe(p, t, bucket, lru) {
817
818 list_for_each_entry(p, bucket, lru) {
819 if (page_private(p) == mfn) { 817 if (page_private(p) == mfn) {
820 ret = p; 818 ret = p;
821 break; 819 break;
822 } 820 }
823 } 821 }
824 822
825 spin_unlock_irqrestore(&m2p_override_lock, flags);
826
827 return ret; 823 return ret;
828} 824}
829 825