vold: Add an optional wipe paramter to the volume format command
The new wipe option to the vold format command will invoke BLKDISCARD
on the partition before invoking newfs_msdos. This will be used whenever
a full wipe of the device is wanted, as this is more secure than just
doing newfs_msdos.
Bug: 9392982
Change-Id: Ie106f1b9cc70abc61206006d1821641c27c7ccae
diff --git a/cryptfs.c b/cryptfs.c
index 1bf7049..c86e712 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -46,6 +46,7 @@
#include "cutils/properties.h"
#include "hardware_legacy/power.h"
#include "VolumeManager.h"
+#include "VoldUtil.h"
#define DM_CRYPT_BUF_SIZE 4096
#define DATA_MNT_POINT "/data"
@@ -115,17 +116,6 @@
return (unsigned int) (len / 512);
}
-static unsigned int get_blkdev_size(int fd)
-{
- unsigned int nr_sec;
-
- if ( (ioctl(fd, BLKGETSIZE, &nr_sec)) == -1) {
- nr_sec = 0;
- }
-
- return nr_sec;
-}
-
static int get_crypt_ftr_info(char **metadata_fname, off64_t *off)
{
static int cached_data = 0;