Skip to content

Commit

Permalink
xen/p2m: m2p_find_override: use list_for_each_entry_safe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefano Stabellini authored and Konrad Rzeszutek Wilk committed Apr 17, 2012
1 parent e8e937b commit b960d6c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions arch/x86/xen/p2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b960d6c

Please sign in to comment.