Re: [PATCH-next 2/3] crypto: api - Provide gfp mask for tfm allocation

Herbert Xu
2023-06-16T00:26:11Z

On Thu, Jun 15, 2023 at 04:38:49PM -0700, Eric Biggers wrote:
>
> Should crypto_clone_cipher() not have a gfp_t argument itself?
>
> I'm wondering if any users of the crypto_clone_*() functions will need anything
> other than GFP_ATOMIC, such as GFP_NOFS or GFP_NOIO.
>
> FWIW, btrfs's support for fscrypt is planned to use per-extent keys. It's
> challenging to implement. I've been thinking it might need a
> crypto_clone_skcipher() function that it can use during filesystem I/O. That
> use case would want GFP_NOFS, I think.

This is usually a small allocation (< 1 page). But if you do
need it then we should add it to the generic cloning interface
crypto_clone_tfm.

Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt