mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
Add no flush internal suspend/resume flag.
This commit is contained in:
committed by
Milan Broz
parent
ea4b586c77
commit
379016fd78
@@ -911,6 +911,10 @@ static int _dm_simple(int task, const char *name, uint32_t dmflags)
|
|||||||
(dmflags & DM_SUSPEND_SKIP_LOCKFS) && !dm_task_skip_lockfs(dmt))
|
(dmflags & DM_SUSPEND_SKIP_LOCKFS) && !dm_task_skip_lockfs(dmt))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
if (task == DM_DEVICE_SUSPEND &&
|
||||||
|
(dmflags & DM_SUSPEND_NOFLUSH) && !dm_task_no_flush(dmt))
|
||||||
|
goto out;
|
||||||
|
|
||||||
r = dm_task_run(dmt);
|
r = dm_task_run(dmt);
|
||||||
out:
|
out:
|
||||||
dm_task_destroy(dmt);
|
dm_task_destroy(dmt);
|
||||||
@@ -1284,6 +1288,9 @@ static int _dm_resume_device(const char *name, uint32_t dmflags)
|
|||||||
if ((dmflags & DM_SUSPEND_SKIP_LOCKFS) && !dm_task_skip_lockfs(dmt))
|
if ((dmflags & DM_SUSPEND_SKIP_LOCKFS) && !dm_task_skip_lockfs(dmt))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
if ((dmflags & DM_SUSPEND_NOFLUSH) && !dm_task_no_flush(dmt))
|
||||||
|
goto out;
|
||||||
|
|
||||||
if (_dm_use_udev() && !_dm_task_set_cookie(dmt, &cookie, udev_flags))
|
if (_dm_use_udev() && !_dm_task_set_cookie(dmt, &cookie, udev_flags))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ struct crypt_params_integrity;
|
|||||||
#define DM_RESUME_PRIVATE (1 << 4) /* CRYPT_ACTIVATE_PRIVATE */
|
#define DM_RESUME_PRIVATE (1 << 4) /* CRYPT_ACTIVATE_PRIVATE */
|
||||||
#define DM_SUSPEND_SKIP_LOCKFS (1 << 5)
|
#define DM_SUSPEND_SKIP_LOCKFS (1 << 5)
|
||||||
#define DM_SUSPEND_WIPE_KEY (1 << 6)
|
#define DM_SUSPEND_WIPE_KEY (1 << 6)
|
||||||
|
#define DM_SUSPEND_NOFLUSH (1 << 7)
|
||||||
|
|
||||||
static inline uint32_t act2dmflags(uint32_t act_flags)
|
static inline uint32_t act2dmflags(uint32_t act_flags)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user