Re: [PATCH v6 2/9] block: Add encryption context to struct bio

Eric Biggers
2020-01-14T21:24:11Z

On Wed, Dec 18, 2019 at 06:51:29AM -0800, Satya Tangirala wrote:
> +static inline void bio_crypt_set_ctx(struct bio *bio,
> + const struct blk_crypto_key *key,
> + u64 dun[BLK_CRYPTO_DUN_ARRAY_SIZE],
> + gfp_t gfp_mask)
> +{
> + struct bio_crypt_ctx *bc = bio_crypt_alloc_ctx(gfp_mask);
> +
> + bc->bc_key = key;
> + memcpy(bc->bc_dun, dun, sizeof(bc->bc_dun));
> + bc->bc_ksm = NULL;
> + bc->bc_keyslot = -1;
> +
> + bio->bi_crypt_context = bc;
> +}

The 'dun' argument should be const.

- Eric