diff options
author | 2021-03-09 13:48:03 -0500 | |
---|---|---|
committer | 2021-10-18 07:49:41 -0400 | |
commit | 121703c1c817b3c77f61002466d0bfca7e39f25d (patch) | |
tree | e71f6e481eec64c9f194fb1203c424bd51b714dc /include | |
parent | mm/filemap: Add FGP_STABLE (diff) | |
download | linux-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')
-rw-r--r-- | include/linux/mm.h | 4 | ||||
-rw-r--r-- | include/linux/pagemap.h | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index efcb06fc6116..40ff114aaf9e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2788,10 +2788,6 @@ extern vm_fault_t filemap_map_pages(struct vm_fault *vmf, pgoff_t start_pgoff, pgoff_t end_pgoff); extern vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf); -/* mm/page-writeback.c */ -int __must_check write_one_page(struct page *page); -void task_dirty_inc(struct task_struct *tsk); - extern unsigned long stack_guard_gap; /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ extern int expand_stack(struct vm_area_struct *vma, unsigned long address); 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); |