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_find_entry to use a folio

Use the new folio APIs to remove calls to compound_head().

[konishi.ryusuke: resolved a conflict due to style warning correction]
Link: https://lkml.kernel.org/r/20231127143036.2425-12-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
a4bf041e b37b2bec

+6 -6
+6 -6
fs/nilfs2/dir.c
··· 339 339 unsigned int reclen = NILFS_DIR_REC_LEN(namelen); 340 340 unsigned long start, n; 341 341 unsigned long npages = dir_pages(dir); 342 - struct page *page = NULL; 342 + struct folio *folio = NULL; 343 343 struct nilfs_inode_info *ei = NILFS_I(dir); 344 344 struct nilfs_dir_entry *de; 345 345 ··· 354 354 start = 0; 355 355 n = start; 356 356 do { 357 - char *kaddr = nilfs_get_page(dir, n, &page); 357 + char *kaddr = nilfs_get_folio(dir, n, &folio); 358 358 359 359 if (!IS_ERR(kaddr)) { 360 360 de = (struct nilfs_dir_entry *)kaddr; ··· 363 363 if (de->rec_len == 0) { 364 364 nilfs_error(dir->i_sb, 365 365 "zero-length directory entry"); 366 - unmap_and_put_page(page, kaddr); 366 + folio_release_kmap(folio, kaddr); 367 367 goto out; 368 368 } 369 369 if (nilfs_match(namelen, name, de)) 370 370 goto found; 371 371 de = nilfs_next_entry(de); 372 372 } 373 - unmap_and_put_page(page, kaddr); 373 + folio_release_kmap(folio, kaddr); 374 374 } 375 375 if (++n >= npages) 376 376 n = 0; 377 - /* next page is past the blocks we've got */ 377 + /* next folio is past the blocks we've got */ 378 378 if (unlikely(n > (dir->i_blocks >> (PAGE_SHIFT - 9)))) { 379 379 nilfs_error(dir->i_sb, 380 380 "dir %lu size %lld exceeds block count %llu", ··· 387 387 return NULL; 388 388 389 389 found: 390 - *res_page = page; 390 + *res_page = &folio->page; 391 391 ei->i_dir_start_lookup = n; 392 392 return de; 393 393 }