mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 11:50:10 +01:00
Data alignment is always 512B sectors count.
This commit is contained in:
committed by
Milan Broz
parent
d2f0773eb8
commit
248f99cad3
@@ -368,7 +368,7 @@ struct crypt_params_plain {
|
||||
*/
|
||||
struct crypt_params_luks1 {
|
||||
const char *hash; /**< hash used in LUKS header */
|
||||
size_t data_alignment; /**< data alignment in sectors, data offset is multiple of this */
|
||||
size_t data_alignment; /**< data area alignment in 512B sectors, data offset is multiple of this */
|
||||
const char *data_device; /**< detached encrypted data device or @e NULL */
|
||||
};
|
||||
|
||||
@@ -490,7 +490,7 @@ struct crypt_params_luks2 {
|
||||
const struct crypt_pbkdf_type *pbkdf; /**< PBKDF (and hash) parameters or @e NULL*/
|
||||
const char *integrity; /**< integrity algorithm or @e NULL */
|
||||
const struct crypt_params_integrity *integrity_params; /**< Data integrity parameters or @e NULL*/
|
||||
size_t data_alignment; /**< data alignment in sectors, data offset is multiple of this */
|
||||
size_t data_alignment; /**< data area alignment in 512B sectors, data offset is multiple of this */
|
||||
const char *data_device; /**< detached encrypted data device or @e NULL */
|
||||
uint32_t sector_size; /**< encryption sector size */
|
||||
const char *label; /**< header label or @e NULL*/
|
||||
|
||||
@@ -1572,9 +1572,9 @@ static int _crypt_format_luks2(struct crypt_device *cd,
|
||||
cd->device = NULL;
|
||||
if (device_alloc(&cd->device, params->data_device) < 0)
|
||||
return -ENOMEM;
|
||||
required_alignment = params->data_alignment * sector_size;
|
||||
required_alignment = params->data_alignment * SECTOR_SIZE;
|
||||
} else if (params && params->data_alignment) {
|
||||
required_alignment = params->data_alignment * sector_size;
|
||||
required_alignment = params->data_alignment * SECTOR_SIZE;
|
||||
} else
|
||||
device_topology_alignment(cd->device,
|
||||
&required_alignment,
|
||||
|
||||
Reference in New Issue
Block a user