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 nilfs_page_bug() to nilfs_folio_bug()

All callers have a folio now, so convert it.

Link: https://lkml.kernel.org/r/20231127143036.2425-18-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
b4f19e3b 9bff5f98

+18 -17
+2 -2
fs/nilfs2/btnode.c
··· 190 190 retry: 191 191 /* BUG_ON(oldkey != obh->b_folio->index); */ 192 192 if (unlikely(oldkey != ofolio->index)) 193 - NILFS_PAGE_BUG(&ofolio->page, 193 + NILFS_FOLIO_BUG(ofolio, 194 194 "invalid oldkey %lld (newkey=%lld)", 195 195 (unsigned long long)oldkey, 196 196 (unsigned long long)newkey); ··· 246 246 if (nbh == NULL) { /* blocksize == pagesize */ 247 247 ofolio = obh->b_folio; 248 248 if (unlikely(oldkey != ofolio->index)) 249 - NILFS_PAGE_BUG(&ofolio->page, 249 + NILFS_FOLIO_BUG(ofolio, 250 250 "invalid oldkey %lld (newkey=%lld)", 251 251 (unsigned long long)oldkey, 252 252 (unsigned long long)newkey);
+13 -12
fs/nilfs2/page.c
··· 150 150 return true; 151 151 } 152 152 153 - void nilfs_page_bug(struct page *page) 153 + void nilfs_folio_bug(struct folio *folio) 154 154 { 155 + struct buffer_head *bh, *head; 155 156 struct address_space *m; 156 157 unsigned long ino; 157 158 158 - if (unlikely(!page)) { 159 - printk(KERN_CRIT "NILFS_PAGE_BUG(NULL)\n"); 159 + if (unlikely(!folio)) { 160 + printk(KERN_CRIT "NILFS_FOLIO_BUG(NULL)\n"); 160 161 return; 161 162 } 162 163 163 - m = page->mapping; 164 + m = folio->mapping; 164 165 ino = m ? m->host->i_ino : 0; 165 166 166 - printk(KERN_CRIT "NILFS_PAGE_BUG(%p): cnt=%d index#=%llu flags=0x%lx " 167 + printk(KERN_CRIT "NILFS_FOLIO_BUG(%p): cnt=%d index#=%llu flags=0x%lx " 167 168 "mapping=%p ino=%lu\n", 168 - page, page_ref_count(page), 169 - (unsigned long long)page->index, page->flags, m, ino); 169 + folio, folio_ref_count(folio), 170 + (unsigned long long)folio->index, folio->flags, m, ino); 170 171 171 - if (page_has_buffers(page)) { 172 - struct buffer_head *bh, *head; 172 + head = folio_buffers(folio); 173 + if (head) { 173 174 int i = 0; 174 175 175 - bh = head = page_buffers(page); 176 + bh = head; 176 177 do { 177 178 printk(KERN_CRIT 178 179 " BH[%d] %p: cnt=%d block#=%llu state=0x%lx\n", ··· 259 258 260 259 folio_lock(folio); 261 260 if (unlikely(!folio_test_dirty(folio))) 262 - NILFS_PAGE_BUG(&folio->page, "inconsistent dirty state"); 261 + NILFS_FOLIO_BUG(folio, "inconsistent dirty state"); 263 262 264 263 dfolio = filemap_grab_folio(dmap, folio->index); 265 264 if (unlikely(IS_ERR(dfolio))) { ··· 269 268 break; 270 269 } 271 270 if (unlikely(!folio_buffers(folio))) 272 - NILFS_PAGE_BUG(&folio->page, 271 + NILFS_FOLIO_BUG(folio, 273 272 "found empty page in dat page cache"); 274 273 275 274 nilfs_copy_folio(dfolio, folio, true);
+3 -3
fs/nilfs2/page.h
··· 37 37 void nilfs_forget_buffer(struct buffer_head *); 38 38 void nilfs_copy_buffer(struct buffer_head *, struct buffer_head *); 39 39 bool nilfs_folio_buffers_clean(struct folio *); 40 - void nilfs_page_bug(struct page *); 40 + void nilfs_folio_bug(struct folio *); 41 41 42 42 int nilfs_copy_dirty_pages(struct address_space *, struct address_space *); 43 43 void nilfs_copy_back_pages(struct address_space *, struct address_space *); ··· 49 49 sector_t start_blk, 50 50 sector_t *blkoff); 51 51 52 - #define NILFS_PAGE_BUG(page, m, a...) \ 53 - do { nilfs_page_bug(page); BUG(); } while (0) 52 + #define NILFS_FOLIO_BUG(folio, m, a...) \ 53 + do { nilfs_folio_bug(folio); BUG(); } while (0) 54 54 55 55 #endif /* _NILFS_PAGE_H */