Skip to content

Commit 8b7d3fe

Browse files
committed
fs/buffer.c: use b_folio for fsverity work
Use b_folio now that it exists. This removes an unnecessary call to compound_head(). No actual change in behavior. Link: https://lore.kernel.org/r/20230224232530.98440-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com>
1 parent 197b6b6 commit 8b7d3fe

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

fs/buffer.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,20 +308,19 @@ static void verify_bh(struct work_struct *work)
308308
struct buffer_head *bh = ctx->bh;
309309
bool valid;
310310

311-
valid = fsverity_verify_blocks(page_folio(bh->b_page), bh->b_size,
312-
bh_offset(bh));
311+
valid = fsverity_verify_blocks(bh->b_folio, bh->b_size, bh_offset(bh));
313312
end_buffer_async_read(bh, valid);
314313
kfree(ctx);
315314
}
316315

317316
static bool need_fsverity(struct buffer_head *bh)
318317
{
319-
struct page *page = bh->b_page;
320-
struct inode *inode = page->mapping->host;
318+
struct folio *folio = bh->b_folio;
319+
struct inode *inode = folio->mapping->host;
321320

322321
return fsverity_active(inode) &&
323322
/* needed by ext4 */
324-
page->index < DIV_ROUND_UP(inode->i_size, PAGE_SIZE);
323+
folio->index < DIV_ROUND_UP(inode->i_size, PAGE_SIZE);
325324
}
326325

327326
static void decrypt_bh(struct work_struct *work)

0 commit comments

Comments
 (0)