Merge 4e71add028 ("Merge branch 'stable/for-linus-5.15-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft") into android-mainline
Steps on the way to 5.15-rc1 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ib3f181326491eb896547d802a6f0a1b3be54ce28
This commit is contained in:
15
mm/filemap.c
15
mm/filemap.c
@@ -260,12 +260,11 @@ static void page_cache_free_page(struct address_space *mapping,
|
||||
void delete_from_page_cache(struct page *page)
|
||||
{
|
||||
struct address_space *mapping = page_mapping(page);
|
||||
unsigned long flags;
|
||||
|
||||
BUG_ON(!PageLocked(page));
|
||||
xa_lock_irqsave(&mapping->i_pages, flags);
|
||||
xa_lock_irq(&mapping->i_pages);
|
||||
__delete_from_page_cache(page, NULL);
|
||||
xa_unlock_irqrestore(&mapping->i_pages, flags);
|
||||
xa_unlock_irq(&mapping->i_pages);
|
||||
|
||||
page_cache_free_page(mapping, page);
|
||||
}
|
||||
@@ -337,19 +336,18 @@ void delete_from_page_cache_batch(struct address_space *mapping,
|
||||
struct pagevec *pvec)
|
||||
{
|
||||
int i;
|
||||
unsigned long flags;
|
||||
|
||||
if (!pagevec_count(pvec))
|
||||
return;
|
||||
|
||||
xa_lock_irqsave(&mapping->i_pages, flags);
|
||||
xa_lock_irq(&mapping->i_pages);
|
||||
for (i = 0; i < pagevec_count(pvec); i++) {
|
||||
trace_mm_filemap_delete_from_page_cache(pvec->pages[i]);
|
||||
|
||||
unaccount_page_cache_page(mapping, pvec->pages[i]);
|
||||
}
|
||||
page_cache_delete_batch(mapping, pvec);
|
||||
xa_unlock_irqrestore(&mapping->i_pages, flags);
|
||||
xa_unlock_irq(&mapping->i_pages);
|
||||
|
||||
for (i = 0; i < pagevec_count(pvec); i++)
|
||||
page_cache_free_page(mapping, pvec->pages[i]);
|
||||
@@ -841,7 +839,6 @@ void replace_page_cache_page(struct page *old, struct page *new)
|
||||
void (*freepage)(struct page *) = mapping->a_ops->freepage;
|
||||
pgoff_t offset = old->index;
|
||||
XA_STATE(xas, &mapping->i_pages, offset);
|
||||
unsigned long flags;
|
||||
|
||||
VM_BUG_ON_PAGE(!PageLocked(old), old);
|
||||
VM_BUG_ON_PAGE(!PageLocked(new), new);
|
||||
@@ -853,7 +850,7 @@ void replace_page_cache_page(struct page *old, struct page *new)
|
||||
|
||||
mem_cgroup_migrate(old, new);
|
||||
|
||||
xas_lock_irqsave(&xas, flags);
|
||||
xas_lock_irq(&xas);
|
||||
xas_store(&xas, new);
|
||||
|
||||
old->mapping = NULL;
|
||||
@@ -866,7 +863,7 @@ void replace_page_cache_page(struct page *old, struct page *new)
|
||||
__dec_lruvec_page_state(old, NR_SHMEM);
|
||||
if (PageSwapBacked(new))
|
||||
__inc_lruvec_page_state(new, NR_SHMEM);
|
||||
xas_unlock_irqrestore(&xas, flags);
|
||||
xas_unlock_irq(&xas);
|
||||
if (freepage)
|
||||
freepage(old);
|
||||
put_page(old);
|
||||
|
||||
Reference in New Issue
Block a user