diff options
author | Kirill Tkhai <ktkhai@virtuozzo.com> | 2018-12-28 03:39:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-28 15:11:51 -0500 |
commit | 451b9514a59f3379d3bedd5a0e4909ef3ef1b98c (patch) | |
tree | e5815105f8e367c02547caf4730e5cd94ae617c4 | |
parent | 4918e7625ffa82f388ea70538f0e1df20ea35a54 (diff) |
mm: remove __hugepage_set_anon_rmap()
This function is identical to __page_set_anon_rmap() since the time, when
it was introduced (8 years ago). The patch removes the function, and
makes its users to use __page_set_anon_rmap() instead.
Link: http://lkml.kernel.org/r/154504875359.30235.6237926369392564851.stgit@localhost.localdomain
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/rmap.c | 25 |
1 files changed, 4 insertions, 21 deletions
@@ -1019,7 +1019,7 @@ void page_move_anon_rmap(struct page *page, struct vm_area_struct *vma) | |||
1019 | 1019 | ||
1020 | /** | 1020 | /** |
1021 | * __page_set_anon_rmap - set up new anonymous rmap | 1021 | * __page_set_anon_rmap - set up new anonymous rmap |
1022 | * @page: Page to add to rmap | 1022 | * @page: Page or Hugepage to add to rmap |
1023 | * @vma: VM area to add page to. | 1023 | * @vma: VM area to add page to. |
1024 | * @address: User virtual address of the mapping | 1024 | * @address: User virtual address of the mapping |
1025 | * @exclusive: the page is exclusively owned by the current process | 1025 | * @exclusive: the page is exclusively owned by the current process |
@@ -1916,27 +1916,10 @@ void rmap_walk_locked(struct page *page, struct rmap_walk_control *rwc) | |||
1916 | 1916 | ||
1917 | #ifdef CONFIG_HUGETLB_PAGE | 1917 | #ifdef CONFIG_HUGETLB_PAGE |
1918 | /* | 1918 | /* |
1919 | * The following three functions are for anonymous (private mapped) hugepages. | 1919 | * The following two functions are for anonymous (private mapped) hugepages. |
1920 | * Unlike common anonymous pages, anonymous hugepages have no accounting code | 1920 | * Unlike common anonymous pages, anonymous hugepages have no accounting code |
1921 | * and no lru code, because we handle hugepages differently from common pages. | 1921 | * and no lru code, because we handle hugepages differently from common pages. |
1922 | */ | 1922 | */ |
1923 | static void __hugepage_set_anon_rmap(struct page *page, | ||
1924 | struct vm_area_struct *vma, unsigned long address, int exclusive) | ||
1925 | { | ||
1926 | struct anon_vma *anon_vma = vma->anon_vma; | ||
1927 | |||
1928 | BUG_ON(!anon_vma); | ||
1929 | |||
1930 | if (PageAnon(page)) | ||
1931 | return; | ||
1932 | if (!exclusive) | ||
1933 | anon_vma = anon_vma->root; | ||
1934 | |||
1935 | anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON; | ||
1936 | page->mapping = (struct address_space *) anon_vma; | ||
1937 | page->index = linear_page_index(vma, address); | ||
1938 | } | ||
1939 | |||
1940 | void hugepage_add_anon_rmap(struct page *page, | 1923 | void hugepage_add_anon_rmap(struct page *page, |
1941 | struct vm_area_struct *vma, unsigned long address) | 1924 | struct vm_area_struct *vma, unsigned long address) |
1942 | { | 1925 | { |
@@ -1948,7 +1931,7 @@ void hugepage_add_anon_rmap(struct page *page, | |||
1948 | /* address might be in next vma when migration races vma_adjust */ | 1931 | /* address might be in next vma when migration races vma_adjust */ |
1949 | first = atomic_inc_and_test(compound_mapcount_ptr(page)); | 1932 | first = atomic_inc_and_test(compound_mapcount_ptr(page)); |
1950 | if (first) | 1933 | if (first) |
1951 | __hugepage_set_anon_rmap(page, vma, address, 0); | 1934 | __page_set_anon_rmap(page, vma, address, 0); |
1952 | } | 1935 | } |
1953 | 1936 | ||
1954 | void hugepage_add_new_anon_rmap(struct page *page, | 1937 | void hugepage_add_new_anon_rmap(struct page *page, |
@@ -1956,6 +1939,6 @@ void hugepage_add_new_anon_rmap(struct page *page, | |||
1956 | { | 1939 | { |
1957 | BUG_ON(address < vma->vm_start || address >= vma->vm_end); | 1940 | BUG_ON(address < vma->vm_start || address >= vma->vm_end); |
1958 | atomic_set(compound_mapcount_ptr(page), 0); | 1941 | atomic_set(compound_mapcount_ptr(page), 0); |
1959 | __hugepage_set_anon_rmap(page, vma, address, 1); | 1942 | __page_set_anon_rmap(page, vma, address, 1); |
1960 | } | 1943 | } |
1961 | #endif /* CONFIG_HUGETLB_PAGE */ | 1944 | #endif /* CONFIG_HUGETLB_PAGE */ |