mm: thp: introduce page_trans_huge_anon_shared

This is the equivalent of "page_trans_huge_mapcount() > 1", but it is
allowed to break the loop and it's meant to be used later outside the
PT lock in the THP COW path to decide if to take the COW copy path as
well as in gup and gup-fast context.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
2 files changed