Re: [PATCH v2 08/11] fscrypt: make ci->ci_direct_key a bool not a pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 10, 2023 at 03:40:01PM -0400, Sweet Tea Dorminy wrote:
> The ci_direct_key field is only used for v1 direct key policies,
> recording the direct key that needs to have its refcount reduced when
> the crypt_info is freed. However, now that crypt_info->ci_enc_key is a
> pointer to the authoritative prepared key -- embedded in the direct key,
> in this case, we no longer need to keep a full pointer to the direct key
> -- we can use container_of() to go from the prepared key to its
> surrounding direct key. Thus we can make ci_direct_key a bool instead of
> a pointer, saving a few bytes.
> 
> Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@xxxxxxxxxx>
> ---
>  fs/crypto/fscrypt_private.h | 7 +++----
>  fs/crypto/keysetup.c        | 2 +-
>  fs/crypto/keysetup_v1.c     | 7 +++++--
>  3 files changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/crypto/fscrypt_private.h b/fs/crypto/fscrypt_private.h
> index 5011737b60b3..b575fb58a506 100644
> --- a/fs/crypto/fscrypt_private.h
> +++ b/fs/crypto/fscrypt_private.h
> @@ -234,10 +234,9 @@ struct fscrypt_info {
>  	struct list_head ci_master_key_link;
>  
>  	/*
> -	 * If non-NULL, then encryption is done using the master key directly
> -	 * and ci_enc_key will equal ci_direct_key->dk_key.
> +	 * If true, then encryption is done using the master key directly.
>  	 */
> -	struct fscrypt_direct_key *ci_direct_key;
> +	bool ci_direct_key;

This just gets deleted by the next patch.  Should they be folded together?

- Eric



[Index of Archives]     [linux Cryptography]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]

  Powered by Linux