Add stand-alone device suspend.

This commit is contained in:
Ondrej Kozina
2018-04-12 10:45:06 +02:00
committed by Milan Broz
parent 6f6e1efbc8
commit 34b8a48252
2 changed files with 18 additions and 0 deletions

View File

@@ -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;

View File

@@ -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);