mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Add stand-alone device suspend.
This commit is contained in:
committed by
Milan Broz
parent
6f6e1efbc8
commit
34b8a48252
@@ -2044,6 +2044,23 @@ out:
|
||||
return r;
|
||||
}
|
||||
|
||||
int dm_suspend_device(struct crypt_device *cd, const char *name)
|
||||
{
|
||||
int r;
|
||||
|
||||
if (dm_init_context(cd, DM_UNKNOWN))
|
||||
return -ENOTSUP;
|
||||
|
||||
if (!_dm_simple(DM_DEVICE_SUSPEND, name, 0))
|
||||
r = -EINVAL;
|
||||
else
|
||||
r = 0;
|
||||
|
||||
dm_exit_context();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
int dm_suspend_and_wipe_key(struct crypt_device *cd, const char *name)
|
||||
{
|
||||
uint32_t dmt_flags;
|
||||
|
||||
@@ -138,6 +138,7 @@ int dm_query_device(struct crypt_device *cd, const char *name,
|
||||
int dm_create_device(struct crypt_device *cd, const char *name,
|
||||
const char *type, struct crypt_dm_active_device *dmd,
|
||||
int reload);
|
||||
int dm_suspend_device(struct crypt_device *cd, const char *name);
|
||||
int dm_suspend_and_wipe_key(struct crypt_device *cd, const char *name);
|
||||
int dm_resume_and_reinstate_key(struct crypt_device *cd, const char *name,
|
||||
const struct volume_key *vk);
|
||||
|
||||
Reference in New Issue
Block a user