diff options
author | Daniel Rosenberg <drosen@google.com> | 2018-08-28 01:58:49 -0700 |
---|---|---|
committer | Paul Lawrence <paullawrence@google.com> | 2018-09-21 21:54:11 +0000 |
commit | 65f99c9e8bd3a546a5dd2f3f4bad1585afbf0dc8 (patch) | |
tree | d2cc8c8f1e1e4e3bbbbd8667c16f4aafee347fcb /cryptfs.cpp | |
parent | 15b9656ae9acfbed4af62b8cecba30c35cd514a8 (diff) | |
download | vold-65f99c9e8bd3a546a5dd2f3f4bad1585afbf0dc8.tar.gz |
Add support for checkpointing
Checkpointing uses a combination of files on the meta partition
and the checkpoint= fs_mgr flag. Checkpointed partitions will
revert to their starting state on reboot unless checkpoint commit
is called.
Test: Run vdc commands, check file on metadata
Merged-In: Icba16578608a6cbf922472e9d4ae5b8cf5f016c6
Change-Id: Icba16578608a6cbf922472e9d4ae5b8cf5f016c6
Diffstat (limited to 'cryptfs.cpp')
-rw-r--r-- | cryptfs.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cryptfs.cpp b/cryptfs.cpp index 00e5519c..383bbe84 100644 --- a/cryptfs.cpp +++ b/cryptfs.cpp @@ -24,6 +24,7 @@ #include "cryptfs.h" +#include "Checkpoint.h" #include "EncryptInplace.h" #include "Ext4Crypt.h" #include "Keymaster.h" @@ -1562,7 +1563,9 @@ static int cryptfs_restart_internal(int restart_main) { SLOGE("Failed to setexeccon"); return -1; } - while ((mount_rc = fs_mgr_do_mount(fstab_default, DATA_MNT_POINT, crypto_blkdev, 0)) != 0) { + bool needs_cp = android::vold::cp_needsCheckpoint(); + while ((mount_rc = fs_mgr_do_mount(fstab_default, DATA_MNT_POINT, crypto_blkdev, 0, + needs_cp)) != 0) { if (mount_rc == FS_MGR_DOMNT_BUSY) { /* TODO: invoke something similar to Process::killProcessWithOpenFiles(DATA_MNT_POINT, |