diff options
author | 2021-05-04 16:12:09 -0400 | |
---|---|---|
committer | 2021-10-18 07:49:40 -0400 | |
commit | fc9b6a538b222eaeb4d1e3f93e716b6626d9b653 (patch) | |
tree | bace0aa13d6853d8cb612fa7a599999018b16adc /include | |
parent | mm/writeback: Add filemap_dirty_folio() (diff) | |
download | linux-fc9b6a538b222eaeb4d1e3f93e716b6626d9b653.tar.gz linux-fc9b6a538b222eaeb4d1e3f93e716b6626d9b653.tar.bz2 linux-fc9b6a538b222eaeb4d1e3f93e716b6626d9b653.zip |
mm/writeback: Add folio_account_cleaned()
Get the statistics right; compound pages were being accounted as a
single page. This didn't matter before now as no filesystem which
supported compound pages did writeback. Also move the declaration
to pagemap.h since this is part of the page cache. Add a wrapper for
account_page_cleaned().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Howells <dhowells@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mm.h | 3 | ||||
-rw-r--r-- | include/linux/pagemap.h | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 00510b02ffe1..f47af4ca4873 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -39,7 +39,6 @@ struct anon_vma_chain; struct file_ra_state; struct user_struct; struct writeback_control; -struct bdi_writeback; struct pt_regs; extern int sysctl_page_lock_unfairness; @@ -2006,8 +2005,6 @@ extern void do_invalidatepage(struct page *page, unsigned int offset, int redirty_page_for_writepage(struct writeback_control *wbc, struct page *page); -void account_page_cleaned(struct page *page, struct address_space *mapping, - struct bdi_writeback *wb); bool folio_mark_dirty(struct folio *folio); bool set_page_dirty(struct page *page); int set_page_dirty_lock(struct page *page); diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index aa9a083083df..8ba7da513ac4 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -778,6 +778,13 @@ static inline void __set_page_dirty(struct page *page, { __folio_mark_dirty(page_folio(page), mapping, warn); } +void folio_account_cleaned(struct folio *folio, struct address_space *mapping, + struct bdi_writeback *wb); +static inline void account_page_cleaned(struct page *page, + struct address_space *mapping, struct bdi_writeback *wb) +{ + return folio_account_cleaned(page_folio(page), mapping, wb); +} int __set_page_dirty_nobuffers(struct page *page); int __set_page_dirty_no_writeback(struct page *page); |