Skip to content

Commit

Permalink
mm: remove page_ref_sub_return()
Browse files Browse the repository at this point in the history
With all callers converted to folios, we can act directly on
folio->_refcount.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Matthew Wilcox (Oracle) authored and akpm00 committed May 6, 2024
1 parent 53e45c4 commit 498aefb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions include/linux/page_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,15 @@ static inline void folio_ref_sub(struct folio *folio, int nr)
page_ref_sub(&folio->page, nr);
}

static inline int page_ref_sub_return(struct page *page, int nr)
static inline int folio_ref_sub_return(struct folio *folio, int nr)
{
int ret = atomic_sub_return(nr, &page->_refcount);
int ret = atomic_sub_return(nr, &folio->_refcount);

if (page_ref_tracepoint_active(page_ref_mod_and_return))
__page_ref_mod_and_return(page, -nr, ret);
__page_ref_mod_and_return(&folio->page, -nr, ret);
return ret;
}

static inline int folio_ref_sub_return(struct folio *folio, int nr)
{
return page_ref_sub_return(&folio->page, nr);
}

static inline void page_ref_inc(struct page *page)
{
atomic_inc(&page->_refcount);
Expand Down

0 comments on commit 498aefb

Please sign in to comment.