/* Getting a lock on a stable anon_vma from a page off the LRU is tricky: page_lock_anon_vma rely on RCU to guard against the races.  */
struct anon_vma* page_lock_anon_vma(struct page *page)
/* Getting a lock on a stable anon_vma from a page off the LRU is tricky: page_lock_anon_vma rely on RCU to guard against the races.  */
struct anon_vma* page_lock_anon_vma(struct page *page)
{
	struct anon_vma *anon_vma;
	unsigned long anon_mapping;
	rcu_read_lock();
	anon_mapping = (unsigned long) ACCESS_ONCE(page->mapping);
	if ((anon_mapping & PAGE_MAPPING_FLAGS) != PAGE_MAPPING_ANON)
		goto out;
	if (!page_mapped(page))
		goto out;
	anon_vma = (struct anon_vma *) (anon_mapping - PAGE_MAPPING_ANON);
	spin_lock(&anon_vma->lock);
	return anon_vma;
out:
	rcu_read_unlock();
	return NULL;
}