From 47bc2ac9b63da87362ce890543d8d955e0ccc36a Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 2 Feb 2026 07:06:35 +0100 Subject: fsverity: push out fsverity_info lookup Pass a struct fsverity_info to the verification and readahead helpers, and push the lookup into the callers. Right now this is a very dumb almost mechanic move that open codes a lot of fsverity_info_addr() calls in the file systems. The subsequent patches will clean this up. This prepares for reducing the number of fsverity_info lookups, which will allow to amortize them better when using a more expensive lookup method. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" Acked-by: David Sterba # btrfs Link: https://lore.kernel.org/r/20260202060754.270269-7-hch@lst.de Signed-off-by: Eric Biggers --- fs/buffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fs/buffer.c') diff --git a/fs/buffer.c b/fs/buffer.c index 838c0c571022..3982253b6805 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -309,9 +309,11 @@ static void verify_bh(struct work_struct *work) struct postprocess_bh_ctx *ctx = container_of(work, struct postprocess_bh_ctx, work); struct buffer_head *bh = ctx->bh; + struct inode *inode = bh->b_folio->mapping->host; bool valid; - valid = fsverity_verify_blocks(bh->b_folio, bh->b_size, bh_offset(bh)); + valid = fsverity_verify_blocks(*fsverity_info_addr(inode), bh->b_folio, + bh->b_size, bh_offset(bh)); end_buffer_async_read(bh, valid); kfree(ctx); } -- cgit