summaryrefslogtreecommitdiffstats
path: root/include/linux/pagemap.h
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2021-03-09 13:48:03 -0500
committerMatthew Wilcox (Oracle) <willy@infradead.org>2021-10-18 07:49:41 -0400
commit121703c1c817b3c77f61002466d0bfca7e39f25d (patch)
treee71f6e481eec64c9f194fb1203c424bd51b714dc /include/linux/pagemap.h
parentb27652d935f41793c5e229a1e8b3a8bb3afe3cc1 (diff)
downloadlinux-121703c1c817b3c77f61002466d0bfca7e39f25d.tar.gz
linux-121703c1c817b3c77f61002466d0bfca7e39f25d.tar.bz2
linux-121703c1c817b3c77f61002466d0bfca7e39f25d.zip
mm/writeback: Add folio_write_one
Transform write_one_page() into folio_write_one() and add a compatibility wrapper. Also move the declaration to pagemap.h as this is page cache functionality that doesn't need to be used by the rest of the kernel. Saves 58 bytes of kernel text. While folio_write_one() is 101 bytes smaller than write_one_page(), the inlined call to page_folio() expands each caller. There are fewer than ten callers so it doesn't seem worth putting a wrapper in the core. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r--include/linux/pagemap.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index b68b053e581f..013cdc90f5fd 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -803,6 +803,11 @@ static inline void cancel_dirty_page(struct page *page)
}
bool folio_clear_dirty_for_io(struct folio *folio);
bool clear_page_dirty_for_io(struct page *page);
+int __must_check folio_write_one(struct folio *folio);
+static inline int __must_check write_one_page(struct page *page)
+{
+ return folio_write_one(page_folio(page));
+}
int __set_page_dirty_nobuffers(struct page *page);
int __set_page_dirty_no_writeback(struct page *page);