mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Rename crypt_get/set reenc_context to luks2_reencrypt.
This commit is contained in:
@@ -222,8 +222,8 @@ int PLAIN_activate(struct crypt_device *cd,
|
||||
uint32_t flags);
|
||||
|
||||
void *crypt_get_hdr(struct crypt_device *cd, const char *type);
|
||||
void crypt_set_reenc_context(struct crypt_device *cd, struct luks2_reenc_context *rh);
|
||||
struct luks2_reenc_context *crypt_get_reenc_context(struct crypt_device *cd);
|
||||
void crypt_set_luks2_reencrypt(struct crypt_device *cd, struct luks2_reenc_context *rh);
|
||||
struct luks2_reenc_context *crypt_get_luks2_reencrypt(struct crypt_device *cd);
|
||||
|
||||
int onlyLUKS2(struct crypt_device *cd);
|
||||
int onlyLUKS2mask(struct crypt_device *cd, uint32_t mask);
|
||||
|
||||
@@ -385,7 +385,7 @@ int LUKS2_device_write_lock(struct crypt_device *cd, struct luks2_hdr *hdr, stru
|
||||
}
|
||||
|
||||
/* run sequence id check only on first write lock (r == 1) and w/o LUKS2 reencryption in-progress */
|
||||
if (r == 1 && !crypt_get_reenc_context(cd)) {
|
||||
if (r == 1 && !crypt_get_luks2_reencrypt(cd)) {
|
||||
log_dbg(cd, "Checking context sequence id matches value stored on disk.");
|
||||
if (LUKS2_check_sequence_id(cd, hdr, device)) {
|
||||
device_write_unlock(cd, device);
|
||||
|
||||
@@ -2786,10 +2786,10 @@ static int reencrypt_load_by_passphrase(struct crypt_device *cd,
|
||||
|
||||
log_dbg(cd, "Loading LUKS2 reencryption context.");
|
||||
|
||||
rh = crypt_get_reenc_context(cd);
|
||||
rh = crypt_get_luks2_reencrypt(cd);
|
||||
if (rh) {
|
||||
LUKS2_reencrypt_free(cd, rh);
|
||||
crypt_set_reenc_context(cd, NULL);
|
||||
crypt_set_luks2_reencrypt(cd, NULL);
|
||||
rh = NULL;
|
||||
}
|
||||
|
||||
@@ -2914,7 +2914,7 @@ static int reencrypt_load_by_passphrase(struct crypt_device *cd,
|
||||
MOVE_REF(rh->vks, *vks);
|
||||
MOVE_REF(rh->reenc_lock, reencrypt_lock);
|
||||
|
||||
crypt_set_reenc_context(cd, rh);
|
||||
crypt_set_luks2_reencrypt(cd, rh);
|
||||
|
||||
return 0;
|
||||
err:
|
||||
@@ -3321,7 +3321,7 @@ static int reencrypt_teardown(struct crypt_device *cd, struct luks2_hdr *hdr,
|
||||
|
||||
/* this frees reencryption lock */
|
||||
LUKS2_reencrypt_free(cd, rh);
|
||||
crypt_set_reenc_context(cd, NULL);
|
||||
crypt_set_luks2_reencrypt(cd, NULL);
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -3347,7 +3347,7 @@ int crypt_reencrypt(struct crypt_device *cd,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rh = crypt_get_reenc_context(cd);
|
||||
rh = crypt_get_luks2_reencrypt(cd);
|
||||
if (!rh || (!rh->reenc_lock && crypt_metadata_locking_enabled())) {
|
||||
log_err(cd, _("Missing or invalid reencrypt context."));
|
||||
return -EINVAL;
|
||||
|
||||
@@ -662,7 +662,7 @@ int crypt_set_data_device(struct crypt_device *cd, const char *device)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (isLUKS2(cd->type) && crypt_get_reenc_context(cd)) {
|
||||
if (isLUKS2(cd->type) && crypt_get_luks2_reencrypt(cd)) {
|
||||
log_err(cd, _("Illegal operation with reencryption in-progress."));
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -5510,13 +5510,13 @@ void *crypt_get_hdr(struct crypt_device *cd, const char *type)
|
||||
}
|
||||
|
||||
/* internal only */
|
||||
struct luks2_reenc_context *crypt_get_reenc_context(struct crypt_device *cd)
|
||||
struct luks2_reenc_context *crypt_get_luks2_reencrypt(struct crypt_device *cd)
|
||||
{
|
||||
return cd->u.luks2.rh;
|
||||
}
|
||||
|
||||
/* internal only */
|
||||
void crypt_set_reenc_context(struct crypt_device *cd, struct luks2_reenc_context *rh)
|
||||
void crypt_set_luks2_reencrypt(struct crypt_device *cd, struct luks2_reenc_context *rh)
|
||||
{
|
||||
cd->u.luks2.rh = rh;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user