mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-10 18:30:00 +01:00
Add dm_error_device routine.
This commit is contained in:
committed by
Milan Broz
parent
2cd85ddf11
commit
d74e7fc084
@@ -925,6 +925,25 @@ error:
|
||||
return r;
|
||||
}
|
||||
|
||||
int dm_error_device(struct crypt_device *cd, const char *name)
|
||||
{
|
||||
int r = -EINVAL;
|
||||
struct crypt_dm_active_device dmd = {};
|
||||
|
||||
if (!name)
|
||||
return -EINVAL;
|
||||
|
||||
if (dm_init_context(cd, DM_UNKNOWN))
|
||||
return -ENOTSUP;
|
||||
|
||||
if (dm_query_device(cd, name, 0, &dmd) && _error_device(name, dmd.size))
|
||||
r = 0;
|
||||
|
||||
dm_exit_context();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
int dm_remove_device(struct crypt_device *cd, const char *name, uint32_t flags)
|
||||
{
|
||||
struct crypt_dm_active_device dmd = {};
|
||||
|
||||
@@ -147,6 +147,7 @@ int dm_suspend_and_wipe_key(struct crypt_device *cd, const char *name);
|
||||
int dm_resume_device(struct crypt_device *cd, const char *name, uint32_t flags);
|
||||
int dm_resume_and_reinstate_key(struct crypt_device *cd, const char *name,
|
||||
const struct volume_key *vk);
|
||||
int dm_error_device(struct crypt_device *cd, const char *name);
|
||||
|
||||
const char *dm_get_dir(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user