Commit 8d29c703 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by akpm

mm/swap: convert __put_page() to __folio_put()

Saves 11 bytes of text by removing a check of PageTail.

Link: https://lkml.kernel.org/r/20220617175020.717127-16-willy@infradead.orgSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 2f58e5de
...@@ -855,7 +855,7 @@ static inline struct folio *virt_to_folio(const void *x) ...@@ -855,7 +855,7 @@ static inline struct folio *virt_to_folio(const void *x)
return page_folio(page); return page_folio(page);
} }
void __put_page(struct page *page); void __folio_put(struct folio *folio);
void put_pages_list(struct list_head *pages); void put_pages_list(struct list_head *pages);
...@@ -1197,7 +1197,7 @@ static inline __must_check bool try_get_page(struct page *page) ...@@ -1197,7 +1197,7 @@ static inline __must_check bool try_get_page(struct page *page)
static inline void folio_put(struct folio *folio) static inline void folio_put(struct folio *folio)
{ {
if (folio_put_testzero(folio)) if (folio_put_testzero(folio))
__put_page(&folio->page); __folio_put(folio);
} }
/** /**
...@@ -1217,7 +1217,7 @@ static inline void folio_put(struct folio *folio) ...@@ -1217,7 +1217,7 @@ static inline void folio_put(struct folio *folio)
static inline void folio_put_refs(struct folio *folio, int refs) static inline void folio_put_refs(struct folio *folio, int refs)
{ {
if (folio_ref_sub_and_test(folio, refs)) if (folio_ref_sub_and_test(folio, refs))
__put_page(&folio->page); __folio_put(folio);
} }
void release_pages(struct page **pages, int nr); void release_pages(struct page **pages, int nr);
......
...@@ -119,16 +119,16 @@ static void __put_compound_page(struct page *page) ...@@ -119,16 +119,16 @@ static void __put_compound_page(struct page *page)
destroy_compound_page(page); destroy_compound_page(page);
} }
void __put_page(struct page *page) void __folio_put(struct folio *folio)
{ {
if (unlikely(is_zone_device_page(page))) if (unlikely(folio_is_zone_device(folio)))
free_zone_device_page(page); free_zone_device_page(&folio->page);
else if (unlikely(PageCompound(page))) else if (unlikely(folio_test_large(folio)))
__put_compound_page(page); __put_compound_page(&folio->page);
else else
__put_single_page(page); __put_single_page(&folio->page);
} }
EXPORT_SYMBOL(__put_page); EXPORT_SYMBOL(__folio_put);
/** /**
* put_pages_list() - release a list of pages * put_pages_list() - release a list of pages
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <linux/dma-direction.h> #include <linux/dma-direction.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/page-flags.h> #include <linux/page-flags.h>
#include <linux/mm.h> /* for __put_page() */ #include <linux/mm.h> /* for put_page() */
#include <linux/poison.h> #include <linux/poison.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment