Unify checking for LUKS2 intermediate device.

Use dm_get_active_iname that should be used on all places.

This function return integrioty device name if it shoudl be
maintained by LUKS2 context directly.

Code must not touch other devices that it does not own.
This commit is contained in:
Milan Broz
2025-05-03 21:26:03 +02:00
parent 352cda0302
commit d967c9aaf0
6 changed files with 76 additions and 58 deletions

View File

@@ -98,7 +98,6 @@ int device_alloc_no_check(struct device **device, const char *path);
void device_close(struct crypt_device *cd, struct device *device);
void device_free(struct crypt_device *cd, struct device *device);
const char *device_path(const struct device *device);
const char *device_dm_name(const struct device *device);
const char *device_block_path(const struct device *device);
void device_topology_alignment(struct crypt_device *cd,
struct device *device,
@@ -178,6 +177,7 @@ int lookup_by_disk_id(const char *dm_uuid);
int lookup_by_sysfs_uuid_field(const char *dm_uuid);
int crypt_uuid_cmp(const char *dm_uuid, const char *hdr_uuid);
int crypt_uuid_type_cmp(const char *dm_uuid, const char *type);
int crypt_uuid_integrity_cmp(const char *dm_uuid, const char *dmi_uuid);
size_t crypt_getpagesize(void);
unsigned crypt_cpusonline(void);