khugepaged: call shmem_get_folio()

JIRA: https://issues.redhat.com/browse/RHEL-1848

commit 7459c149ae9ca7d6f241b3a3764aa81b9c405a0e
Author: Matthew Wilcox (Oracle) <willy@infradead.org>
Date:   Fri Sep 2 20:46:27 2022 +0100

    khugepaged: call shmem_get_folio()

    shmem_getpage() is being removed, so call its replacement and find the
    precise page ourselves.

    Link: https://lkml.kernel.org/r/20220902194653.1739778-32-willy@infradead.org
    Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Signed-off-by: Chris von Recklinghausen <crecklin@redhat.com>
This commit is contained in:
Chris von Recklinghausen 2023-10-20 06:13:58 -04:00
parent ec79e4a7e8
commit 550b92cdb3
2 changed files with 7 additions and 4 deletions

View File

@ -1705,13 +1705,16 @@ static int collapse_file(struct mm_struct *mm, struct file *file,
}
if (xa_is_value(page) || !PageUptodate(page)) {
struct folio *folio;
xas_unlock_irq(&xas);
/* swap in or instantiate fallocated page */
if (shmem_getpage(mapping->host, index, &page,
SGP_NOALLOC)) {
if (shmem_get_folio(mapping->host, index,
&folio, SGP_NOALLOC)) {
result = SCAN_FAIL;
goto xa_unlocked;
}
page = folio_file_page(folio, index);
} else if (trylock_page(page)) {
get_page(page);
xas_unlock_irq(&xas);

View File

@ -3169,7 +3169,7 @@ static const char *shmem_get_link(struct dentry *dentry,
folio = filemap_get_folio(inode->i_mapping, 0);
if (!folio)
return ERR_PTR(-ECHILD);
if (PageHWPoison(&folio->page) ||
if (PageHWPoison(folio_page(folio, 0)) ||
!folio_test_uptodate(folio)) {
folio_put(folio);
return ERR_PTR(-ECHILD);
@ -3180,7 +3180,7 @@ static const char *shmem_get_link(struct dentry *dentry,
return ERR_PTR(error);
if (!folio)
return ERR_PTR(-ECHILD);
if (PageHWPoison(&folio->page)) {
if (PageHWPoison(folio_page(folio, 0))) {
folio_unlock(folio);
folio_put(folio);
return ERR_PTR(-ECHILD);