mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Simplify LUKS2 sector_size helpers.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user