Re: [PATCH v4 02/15] fs/crypto: use accessors

Eric Biggers
2025-07-25T04:01:58Z

On Wed, Jul 23, 2025 at 12:57:40PM +0200, Christian Brauner wrote:
> They can be removed once all filesystems have been converted to make
> room for fscrypt info in their own inodes.

Also note that the accessors still exist at the end of the series. I'm
not sure what the above sentence is trying to say.

> @@ -396,10 +396,10 @@ bool fscrypt_mergeable_bio(struct bio *bio, const struct inode *inode,
> * uses the same pointer. I.e., there's currently no need to support
> * merging requests where the keys are the same but the pointers differ.
> */
> - if (bc->bc_key != inode->i_crypt_info->ci_enc_key.blk_key)
> + if (bc->bc_key != fscrypt_get_inode_info_raw(inode)->ci_enc_key.blk_key)
> return false;
>
> - fscrypt_generate_dun(inode->i_crypt_info, next_lblk, next_dun);
> + fscrypt_generate_dun(fscrypt_get_inode_info_raw(inode), next_lblk, next_dun);
> return bio_crypt_dun_is_contiguous(bc, bio->bi_iter.bi_size, next_dun);
> }

This function could use a 'ci' local variable now. It's not clear that
the second fscrypt_get_inode_info_raw() will get optimized out.

- Eric