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

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

Link: https://lkml.kernel.org/r/20231127143036.2425-11-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
b37b2bec 75ad5db6

+5 -5
+5 -5
fs/nilfs2/dir.c
··· 284 284 for ( ; n < npages; n++, offset = 0) { 285 285 char *kaddr, *limit; 286 286 struct nilfs_dir_entry *de; 287 - struct page *page; 287 + struct folio *folio; 288 288 289 - kaddr = nilfs_get_page(inode, n, &page); 289 + kaddr = nilfs_get_folio(inode, n, &folio); 290 290 if (IS_ERR(kaddr)) { 291 291 nilfs_error(sb, "bad page in #%lu", inode->i_ino); 292 292 ctx->pos += PAGE_SIZE - offset; ··· 298 298 for ( ; (char *)de <= limit; de = nilfs_next_entry(de)) { 299 299 if (de->rec_len == 0) { 300 300 nilfs_error(sb, "zero-length directory entry"); 301 - unmap_and_put_page(page, kaddr); 301 + folio_release_kmap(folio, kaddr); 302 302 return -EIO; 303 303 } 304 304 if (de->inode) { ··· 311 311 312 312 if (!dir_emit(ctx, de->name, de->name_len, 313 313 le64_to_cpu(de->inode), t)) { 314 - unmap_and_put_page(page, kaddr); 314 + folio_release_kmap(folio, kaddr); 315 315 return 0; 316 316 } 317 317 } 318 318 ctx->pos += nilfs_rec_len_from_disk(de->rec_len); 319 319 } 320 - unmap_and_put_page(page, kaddr); 320 + folio_release_kmap(folio, kaddr); 321 321 } 322 322 return 0; 323 323 }