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.

fscrypt: convert bh_get_inode_and_lblk_num to use a folio

Patch series "Remove page_mapping()".

There are only a few users left. Convert them all to either call
folio_mapping() or just use folio->mapping directly.


This patch (of 6):

Remove uses of page->index, page_mapping() and b_page. Saves a call
to compound_head().

Link: https://lkml.kernel.org/r/20240423225552.4113447-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20240423225552.4113447-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
262f014d b650e1d2

+3 -3
+3 -3
fs/crypto/inline_crypt.c
··· 284 284 const struct inode **inode_ret, 285 285 u64 *lblk_num_ret) 286 286 { 287 - struct page *page = bh->b_page; 287 + struct folio *folio = bh->b_folio; 288 288 const struct address_space *mapping; 289 289 const struct inode *inode; 290 290 ··· 292 292 * The ext4 journal (jbd2) can submit a buffer_head it directly created 293 293 * for a non-pagecache page. fscrypt doesn't care about these. 294 294 */ 295 - mapping = page_mapping(page); 295 + mapping = folio_mapping(folio); 296 296 if (!mapping) 297 297 return false; 298 298 inode = mapping->host; 299 299 300 300 *inode_ret = inode; 301 - *lblk_num_ret = ((u64)page->index << (PAGE_SHIFT - inode->i_blkbits)) + 301 + *lblk_num_ret = ((u64)folio->index << (PAGE_SHIFT - inode->i_blkbits)) + 302 302 (bh_offset(bh) >> inode->i_blkbits); 303 303 return true; 304 304 }