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
diff --git a/cryptfs.cpp b/cryptfs.cpp
index 00e5519..383bbe8 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 @@
             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,