]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
xen/p2m: m2p_find_override: use list_for_each_entry_safe
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 27 Mar 2012 13:52:44 +0000 (14:52 +0100)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 17 Apr 2012 17:27:28 +0000 (13:27 -0400)
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>
arch/x86/xen/p2m.c

index 1b267e75158d8d29d888788d0ac12da38a719a34..7ed8cc3434c5f91efb35acd4cebf09923849107d 100644 (file)
@@ -809,21 +809,17 @@ struct page *m2p_find_override(unsigned long mfn)
 {
        unsigned long flags;
        struct list_head *bucket = &m2p_overrides[mfn_hash(mfn)];
-       struct page *p, *ret;
+       struct page *p, *t, *ret;
 
        ret = NULL;
 
-       spin_lock_irqsave(&m2p_override_lock, flags);
-
-       list_for_each_entry(p, bucket, lru) {
+       list_for_each_entry_safe(p, t, bucket, lru) {
                if (page_private(p) == mfn) {
                        ret = p;
                        break;
                }
        }
 
-       spin_unlock_irqrestore(&m2p_override_lock, flags);
-
        return ret;
 }