mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 10:42:11 +00:00
mm: remove references to page->index in huge_memory.c
We already have folios in all these places; it's just a matter of using them instead of the pages. Link: https://lkml.kernel.org/r/20241005200121.3231142-7-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
0386aaa6e9
commit
544ec0ed37
@ -3199,8 +3199,8 @@ static void __split_huge_page_tail(struct folio *folio, int tail,
|
|||||||
/* ->mapping in first and second tail page is replaced by other uses */
|
/* ->mapping in first and second tail page is replaced by other uses */
|
||||||
VM_BUG_ON_PAGE(tail > 2 && page_tail->mapping != TAIL_MAPPING,
|
VM_BUG_ON_PAGE(tail > 2 && page_tail->mapping != TAIL_MAPPING,
|
||||||
page_tail);
|
page_tail);
|
||||||
page_tail->mapping = head->mapping;
|
new_folio->mapping = folio->mapping;
|
||||||
page_tail->index = head->index + tail;
|
new_folio->index = folio->index + tail;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* page->private should not be set in tail pages. Fix up and warn once
|
* page->private should not be set in tail pages. Fix up and warn once
|
||||||
@ -3276,11 +3276,11 @@ static void __split_huge_page(struct page *page, struct list_head *list,
|
|||||||
ClearPageHasHWPoisoned(head);
|
ClearPageHasHWPoisoned(head);
|
||||||
|
|
||||||
for (i = nr - new_nr; i >= new_nr; i -= new_nr) {
|
for (i = nr - new_nr; i >= new_nr; i -= new_nr) {
|
||||||
|
struct folio *tail;
|
||||||
__split_huge_page_tail(folio, i, lruvec, list, new_order);
|
__split_huge_page_tail(folio, i, lruvec, list, new_order);
|
||||||
|
tail = page_folio(head + i);
|
||||||
/* Some pages can be beyond EOF: drop them from page cache */
|
/* Some pages can be beyond EOF: drop them from page cache */
|
||||||
if (head[i].index >= end) {
|
if (tail->index >= end) {
|
||||||
struct folio *tail = page_folio(head + i);
|
|
||||||
|
|
||||||
if (shmem_mapping(folio->mapping))
|
if (shmem_mapping(folio->mapping))
|
||||||
nr_dropped++;
|
nr_dropped++;
|
||||||
else if (folio_test_clear_dirty(tail))
|
else if (folio_test_clear_dirty(tail))
|
||||||
@ -3288,12 +3288,12 @@ static void __split_huge_page(struct page *page, struct list_head *list,
|
|||||||
inode_to_wb(folio->mapping->host));
|
inode_to_wb(folio->mapping->host));
|
||||||
__filemap_remove_folio(tail, NULL);
|
__filemap_remove_folio(tail, NULL);
|
||||||
folio_put(tail);
|
folio_put(tail);
|
||||||
} else if (!PageAnon(page)) {
|
} else if (!folio_test_anon(folio)) {
|
||||||
__xa_store(&folio->mapping->i_pages, head[i].index,
|
__xa_store(&folio->mapping->i_pages, tail->index,
|
||||||
head + i, 0);
|
tail, 0);
|
||||||
} else if (swap_cache) {
|
} else if (swap_cache) {
|
||||||
__xa_store(&swap_cache->i_pages, offset + i,
|
__xa_store(&swap_cache->i_pages, offset + i,
|
||||||
head + i, 0);
|
tail, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user