Commit cf1d3417 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton

buffer: use b_folio in mark_buffer_dirty()

Removes about four calls to compound_head().  Two of them are inline which
removes 132 bytes from the kernel text.

Link: https://lkml.kernel.org/r/20221215214402.3522366-8-willy@infradead.orgSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent c10d9119
...@@ -1095,16 +1095,16 @@ void mark_buffer_dirty(struct buffer_head *bh) ...@@ -1095,16 +1095,16 @@ void mark_buffer_dirty(struct buffer_head *bh)
} }
if (!test_set_buffer_dirty(bh)) { if (!test_set_buffer_dirty(bh)) {
struct page *page = bh->b_page; struct folio *folio = bh->b_folio;
struct address_space *mapping = NULL; struct address_space *mapping = NULL;
lock_page_memcg(page); folio_memcg_lock(folio);
if (!TestSetPageDirty(page)) { if (!folio_test_set_dirty(folio)) {
mapping = page_mapping(page); mapping = folio->mapping;
if (mapping) if (mapping)
__set_page_dirty(page, mapping, 0); __folio_mark_dirty(folio, mapping, 0);
} }
unlock_page_memcg(page); folio_memcg_unlock(folio);
if (mapping) if (mapping)
__mark_inode_dirty(mapping->host, I_DIRTY_PAGES); __mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
} }
......
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