mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
Do not require init_done for some deive helpers.
It processes only name, no need to depend on real device checks (for direct-io) etc.
This commit is contained in:
@@ -470,7 +470,7 @@ void device_free(struct crypt_device *cd, struct device *device)
|
|||||||
/* Get block device path */
|
/* Get block device path */
|
||||||
const char *device_block_path(const struct device *device)
|
const char *device_block_path(const struct device *device)
|
||||||
{
|
{
|
||||||
if (!device || !device->init_done)
|
if (!device)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return device->path;
|
return device->path;
|
||||||
@@ -482,7 +482,7 @@ const char *device_dm_name(const struct device *device)
|
|||||||
const char *dmdir = dm_get_dir();
|
const char *dmdir = dm_get_dir();
|
||||||
size_t dmdir_len = strlen(dmdir);
|
size_t dmdir_len = strlen(dmdir);
|
||||||
|
|
||||||
if (!device || !device->init_done)
|
if (!device)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (strncmp(device->path, dmdir, dmdir_len))
|
if (strncmp(device->path, dmdir, dmdir_len))
|
||||||
|
|||||||
Reference in New Issue
Block a user