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_folio_buffers_clean()

All callers of nilfs_page_buffers_clean() now have a folio, so convert it
to take a folio. While I'm at it, make it return a bool.

Link: https://lkml.kernel.org/r/20231114084436.2755-6-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
36319c0c 797e25ad

+12 -12
+9 -9
fs/nilfs2/page.c
··· 81 81 82 82 lock_buffer(bh); 83 83 set_mask_bits(&bh->b_state, clear_bits, 0); 84 - if (nilfs_page_buffers_clean(&folio->page)) 84 + if (nilfs_folio_buffers_clean(folio)) 85 85 __nilfs_clear_page_dirty(&folio->page); 86 86 87 87 bh->b_blocknr = -1; ··· 131 131 } 132 132 133 133 /** 134 - * nilfs_page_buffers_clean - check if a page has dirty buffers or not. 135 - * @page: page to be checked 134 + * nilfs_folio_buffers_clean - Check if a folio has dirty buffers or not. 135 + * @folio: Folio to be checked. 136 136 * 137 - * nilfs_page_buffers_clean() returns zero if the page has dirty buffers. 138 - * Otherwise, it returns non-zero value. 137 + * nilfs_folio_buffers_clean() returns false if the folio has dirty buffers. 138 + * Otherwise, it returns true. 139 139 */ 140 - int nilfs_page_buffers_clean(struct page *page) 140 + bool nilfs_folio_buffers_clean(struct folio *folio) 141 141 { 142 142 struct buffer_head *bh, *head; 143 143 144 - bh = head = page_buffers(page); 144 + bh = head = folio_buffers(folio); 145 145 do { 146 146 if (buffer_dirty(bh)) 147 - return 0; 147 + return false; 148 148 bh = bh->b_this_page; 149 149 } while (bh != head); 150 - return 1; 150 + return true; 151 151 } 152 152 153 153 void nilfs_page_bug(struct page *page)
+1 -1
fs/nilfs2/page.h
··· 36 36 unsigned long, unsigned long); 37 37 void nilfs_forget_buffer(struct buffer_head *); 38 38 void nilfs_copy_buffer(struct buffer_head *, struct buffer_head *); 39 - int nilfs_page_buffers_clean(struct page *); 39 + bool nilfs_folio_buffers_clean(struct folio *); 40 40 void nilfs_page_bug(struct page *); 41 41 42 42 int nilfs_copy_dirty_pages(struct address_space *, struct address_space *);
+2 -2
fs/nilfs2/segment.c
··· 1759 1759 * all the buffers get cleaned later. 1760 1760 */ 1761 1761 folio_lock(folio); 1762 - if (nilfs_page_buffers_clean(&folio->page)) 1762 + if (nilfs_folio_buffers_clean(folio)) 1763 1763 __nilfs_clear_page_dirty(&folio->page); 1764 1764 folio_unlock(folio); 1765 1765 } ··· 1767 1767 } 1768 1768 1769 1769 if (!err) { 1770 - if (!nilfs_page_buffers_clean(&folio->page)) 1770 + if (!nilfs_folio_buffers_clean(folio)) 1771 1771 filemap_dirty_folio(folio->mapping, folio); 1772 1772 folio_clear_error(folio); 1773 1773 } else {