khugepaged: call shmem_get_folio()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 2 Sep 2022 19:46:27 +0000 (20:46 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 3 Oct 2022 21:02:50 +0000 (14:02 -0700)
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>
mm/khugepaged.c
mm/shmem.c

index 1e59fe7bfae36476af201bebe56baa1d37004200..57af2c841b4101133b59508d0fb022edf30d9884 100644 (file)
@@ -1647,13 +1647,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);
index e6e934adeed7f1c392a683c28c0a1db5dbe1284a..909149b25d98bb77ff4791ab5c034d843a7bbbcc 100644 (file)
@@ -3158,7 +3158,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);
@@ -3169,7 +3169,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);