Skip to content

Commit

Permalink
fs: Remove aops->freepage
Browse files Browse the repository at this point in the history
All implementations now use free_folio so we can delete the callers
and the method.

Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
  • Loading branch information
Matthew Wilcox (Oracle) committed May 10, 2022
1 parent 6612ed2 commit 8560cb1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
1 change: 0 additions & 1 deletion include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ struct address_space_operations {
void (*invalidate_folio) (struct folio *, size_t offset, size_t len);
bool (*release_folio)(struct folio *, gfp_t);
void (*free_folio)(struct folio *folio);
void (*freepage)(struct page *);
ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter);
/*
* migrate the contents of a page to the specified target. If
Expand Down
7 changes: 0 additions & 7 deletions mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,12 @@ void __filemap_remove_folio(struct folio *folio, void *shadow)

void filemap_free_folio(struct address_space *mapping, struct folio *folio)
{
void (*freepage)(struct page *);
void (*free_folio)(struct folio *);
int refs = 1;

free_folio = mapping->a_ops->free_folio;
if (free_folio)
free_folio(folio);
freepage = mapping->a_ops->freepage;
if (freepage)
freepage(&folio->page);

if (folio_test_large(folio) && !folio_test_hugetlb(folio))
refs = folio_nr_pages(folio);
Expand Down Expand Up @@ -812,7 +808,6 @@ void replace_page_cache_page(struct page *old, struct page *new)
struct folio *fnew = page_folio(new);
struct address_space *mapping = old->mapping;
void (*free_folio)(struct folio *) = mapping->a_ops->free_folio;
void (*freepage)(struct page *) = mapping->a_ops->freepage;
pgoff_t offset = old->index;
XA_STATE(xas, &mapping->i_pages, offset);

Expand Down Expand Up @@ -842,8 +837,6 @@ void replace_page_cache_page(struct page *old, struct page *new)
xas_unlock_irq(&xas);
if (free_folio)
free_folio(fold);
if (freepage)
freepage(old);
folio_put(fold);
}
EXPORT_SYMBOL_GPL(replace_page_cache_page);
Expand Down
4 changes: 0 additions & 4 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,10 +1283,8 @@ static int __remove_mapping(struct address_space *mapping, struct folio *folio,
put_swap_page(&folio->page, swap);
} else {
void (*free_folio)(struct folio *);
void (*freepage)(struct page *);

free_folio = mapping->a_ops->free_folio;
freepage = mapping->a_ops->freepage;
/*
* Remember a shadow entry for reclaimed file cache in
* order to detect refaults, thus thrashing, later on.
Expand Down Expand Up @@ -1314,8 +1312,6 @@ static int __remove_mapping(struct address_space *mapping, struct folio *folio,

if (free_folio)
free_folio(folio);
if (freepage)
freepage(&folio->page);
}

return 1;
Expand Down

0 comments on commit 8560cb1

Please sign in to comment.