vold: Internally use sector counts for asec lengths

Signed-off-by: San Mehat <san@google.com>
diff --git a/Loop.cpp b/Loop.cpp
index b8106ef..a54d73e 100644
--- a/Loop.cpp
+++ b/Loop.cpp
@@ -181,17 +181,17 @@
     return -1;
 }
 
-int Loop::createImageFile(const char *file, size_t sizeMb) {
+int Loop::createImageFile(const char *file, unsigned int numSectors) {
     int fd;
 
-    LOGD("Creating ASEC image file %s (%d mb)", file, sizeMb);
+    LOGD("Creating ASEC image file %s (%u sectors)", file, numSectors);
 
     if ((fd = creat(file, 0600)) < 0) {
         LOGE("Error creating imagefile (%s)", strerror(errno));
         return -1;
     }
 
-    if (ftruncate(fd, 1024 + (sizeMb * (1024 * 1024))) < 0) {
+    if (ftruncate(fd, numSectors * 512) < 0) {
         LOGE("Error truncating imagefile (%s)", strerror(errno));
         close(fd);
         return -1;