Add dm_clear_device routine.

This commit is contained in:
Ondrej Kozina
2018-12-10 22:09:21 +01:00
committed by Milan Broz
parent d74e7fc084
commit 675cf7ef59
5 changed files with 368 additions and 31 deletions

View File

@@ -944,6 +944,24 @@ int dm_error_device(struct crypt_device *cd, const char *name)
return r;
}
int dm_clear_device(struct crypt_device *cd, const char *name)
{
int r = -EINVAL;
if (!name)
return r;
if (dm_init_context(cd, DM_UNKNOWN))
return -ENOTSUP;
if (_dm_simple(DM_DEVICE_CLEAR, name))
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 = {};