Simplify LUKS2 sector_size helpers.

This commit is contained in:
Ondrej Kozina
2022-06-10 14:23:30 +02:00
parent e23992d531
commit 75e429b8d1
5 changed files with 17 additions and 21 deletions

View File

@@ -2235,15 +2235,9 @@ int LUKS2_get_volume_key_size(struct luks2_hdr *hdr, int segment)
return -1;
}
int LUKS2_get_sector_size(struct luks2_hdr *hdr)
uint32_t LUKS2_get_sector_size(struct luks2_hdr *hdr)
{
json_object *jobj_segment;
jobj_segment = LUKS2_get_segment_jobj(hdr, CRYPT_DEFAULT_SEGMENT);
if (!jobj_segment)
return SECTOR_SIZE;
return json_segment_get_sector_size(jobj_segment) ?: SECTOR_SIZE;
return json_segment_get_sector_size(LUKS2_get_segment_jobj(hdr, CRYPT_DEFAULT_SEGMENT));
}
int LUKS2_assembly_multisegment_dmd(struct crypt_device *cd,