static int _crypt_load_bitlk(struct crypt_device *cd,
			     struct bitlk_metadata *params __attribute__((unused)))
{
	int r;

	r = init_crypto(cd);
	if (r < 0)
		return r;

	r = BITLK_read_sb(cd, &cd->u.bitlk.params);
	if (r < 0)
		return r;

	if (asprintf(&cd->u.bitlk.cipher_spec, "%s-%s",
		     cd->u.bitlk.params.cipher, cd->u.bitlk.params.cipher_mode) < 0) {
		cd->u.bitlk.cipher_spec = NULL;
		return -ENOMEM;
	}

	if (!cd->type && !(cd->type = strdup(CRYPT_BITLK)))
		return -ENOMEM;

	device_set_block_size(crypt_data_device(cd), cd->u.bitlk.params.sector_size);

	return 0;
}
static int _crypt_load_bitlk(struct crypt_device *cd,
			     struct bitlk_metadata *params __attribute__((unused)))
{
	int r;

	r = init_crypto(cd);
	if (r < 0)
		return r;

	r = BITLK_read_sb(cd, &cd->u.bitlk.params);
	if (r < 0)
		return r;

	if (asprintf(&cd->u.bitlk.cipher_spec, "%s-%s",
		     cd->u.bitlk.params.cipher, cd->u.bitlk.params.cipher_mode) < 0) {
		cd->u.bitlk.cipher_spec = NULL;
		return -ENOMEM;
	}

	if (!cd->type && !(cd->type = strdup(CRYPT_BITLK)))
		return -ENOMEM;

	device_set_block_size(crypt_data_device(cd), cd->u.bitlk.params.sector_size);

	return 0;
}