Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nilfs2: convert to __nilfs_clear_folio_dirty()

All callers now have a folio, so convert to pass a folio. No caller uses
the return value, so make it return void. Removes a couple of hidden
calls to compound_head().

Link: https://lkml.kernel.org/r/20231114084436.2755-10-konishi.ryusuke@gmail.com
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
6609e235 5d3b5903

+12 -11
+10 -9
fs/nilfs2/page.c
··· 82 82 lock_buffer(bh); 83 83 set_mask_bits(&bh->b_state, clear_bits, 0); 84 84 if (nilfs_folio_buffers_clean(folio)) 85 - __nilfs_clear_page_dirty(&folio->page); 85 + __nilfs_clear_folio_dirty(folio); 86 86 87 87 bh->b_blocknr = -1; 88 88 folio_clear_uptodate(folio); ··· 428 428 } while (bh = bh->b_this_page, bh != head); 429 429 } 430 430 431 - __nilfs_clear_page_dirty(&folio->page); 431 + __nilfs_clear_folio_dirty(folio); 432 432 } 433 433 434 434 unsigned int nilfs_page_count_clean_buffers(struct page *page, ··· 458 458 * 2) Some B-tree operations like insertion or deletion may dispose buffers 459 459 * in dirty state, and this needs to cancel the dirty state of their pages. 460 460 */ 461 - int __nilfs_clear_page_dirty(struct page *page) 461 + void __nilfs_clear_folio_dirty(struct folio *folio) 462 462 { 463 - struct address_space *mapping = page->mapping; 463 + struct address_space *mapping = folio->mapping; 464 464 465 465 if (mapping) { 466 466 xa_lock_irq(&mapping->i_pages); 467 - if (test_bit(PG_dirty, &page->flags)) { 468 - __xa_clear_mark(&mapping->i_pages, page_index(page), 467 + if (folio_test_dirty(folio)) { 468 + __xa_clear_mark(&mapping->i_pages, folio->index, 469 469 PAGECACHE_TAG_DIRTY); 470 470 xa_unlock_irq(&mapping->i_pages); 471 - return clear_page_dirty_for_io(page); 471 + folio_clear_dirty_for_io(folio); 472 + return; 472 473 } 473 474 xa_unlock_irq(&mapping->i_pages); 474 - return 0; 475 + return; 475 476 } 476 - return TestClearPageDirty(page); 477 + folio_clear_dirty(folio); 477 478 } 478 479 479 480 /**
+1 -1
fs/nilfs2/page.h
··· 30 30 BUFFER_FNS(NILFS_Redirected, nilfs_redirected) /* redirected to a copy */ 31 31 32 32 33 - int __nilfs_clear_page_dirty(struct page *); 33 + void __nilfs_clear_folio_dirty(struct folio *); 34 34 35 35 struct buffer_head *nilfs_grab_buffer(struct inode *, struct address_space *, 36 36 unsigned long, unsigned long);
+1 -1
fs/nilfs2/segment.c
··· 1760 1760 */ 1761 1761 folio_lock(folio); 1762 1762 if (nilfs_folio_buffers_clean(folio)) 1763 - __nilfs_clear_page_dirty(&folio->page); 1763 + __nilfs_clear_folio_dirty(folio); 1764 1764 folio_unlock(folio); 1765 1765 } 1766 1766 return;