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.

ext4: open code fscrypt_set_bio_crypt_ctx_bh

io_submit_init_bio already has or can easily get at most information
needed to set the crypto context. Open code fscrypt_set_bio_crypt_ctx_bh
based on that.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20260302141922.370070-3-hch@lst.de
Signed-off-by: Eric Biggers <ebiggers@kernel.org>

authored by

Christoph Hellwig and committed by
Eric Biggers
d3fc0edc 7737b1b4

+5 -2
+5 -2
fs/ext4/page-io.c
··· 417 417 418 418 static void io_submit_init_bio(struct ext4_io_submit *io, 419 419 struct inode *inode, 420 + struct folio *folio, 420 421 struct buffer_head *bh) 421 422 { 422 423 struct bio *bio; ··· 427 426 * __GFP_DIRECT_RECLAIM is set, see comments for bio_alloc_bioset(). 428 427 */ 429 428 bio = bio_alloc(bh->b_bdev, BIO_MAX_VECS, REQ_OP_WRITE, GFP_NOIO); 430 - fscrypt_set_bio_crypt_ctx_bh(bio, bh, GFP_NOIO); 429 + fscrypt_set_bio_crypt_ctx(bio, inode, 430 + (folio_pos(folio) + bh_offset(bh)) >> inode->i_blkbits, 431 + GFP_NOIO); 431 432 bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); 432 433 bio->bi_end_io = ext4_end_bio; 433 434 bio->bi_private = ext4_get_io_end(io->io_end); ··· 451 448 ext4_io_submit(io); 452 449 } 453 450 if (io->io_bio == NULL) 454 - io_submit_init_bio(io, inode, bh); 451 + io_submit_init_bio(io, inode, folio, bh); 455 452 if (!bio_add_folio(io->io_bio, io_folio, bh->b_size, bh_offset(bh))) 456 453 goto submit_and_retry; 457 454 wbc_account_cgroup_owner(io->io_wbc, folio, bh->b_size);