Lines Matching refs:asecFileName
142 static int setupLoopDevice(char* buffer, size_t len, const char* asecFileName, const char* idHash, bool debug) {
144 if (Loop::create(idHash, asecFileName, buffer, len)) {
145 SLOGE("ASEC loop device creation failed for %s (%s)", asecFileName, strerror(errno));
153 SLOGD("Found active loopback for %s at %s", asecFileName, buffer);
159 static int setupDevMapperDevice(char* buffer, size_t len, const char* loopDevice, const char* asecFileName, const char* key, const char* idHash , unsigned long numImgSectors, bool* createdDMDevice, bool debug) {
164 SLOGE("ASEC device mapping failed for %s (%s)", asecFileName, strerror(errno));
172 SLOGD("Found active devmapper for %s at %s", asecFileName, buffer);
706 char asecFileName[255];
714 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
720 if (access(asecFileName, F_OK)) {
736 char asecFileName[255];
744 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
750 if (access(asecFileName, F_OK)) {
755 int written = snprintf(buffer, maxlen, "%s", asecFileName);
797 char asecFileName[255];
799 if (!findAsec(id, asecFileName, sizeof(asecFileName))) {
801 asecFileName, strerror(errno));
808 int written = snprintf(asecFileName, sizeof(asecFileName), "%s/%s.asec", asecDir, id);
809 if ((written < 0) || (size_t(written) >= sizeof(asecFileName))) {
814 if (!access(asecFileName, F_OK)) {
816 asecFileName, strerror(errno));
828 if (Loop::createImageFile(asecFileName, numImgSectors + 1)) {
836 unlink(asecFileName);
841 if (Loop::create(idHash, asecFileName, loopDevice, sizeof(loopDevice))) {
843 unlink(asecFileName);
857 unlink(asecFileName);
874 unlink(asecFileName);
889 unlink(asecFileName);
905 unlink(asecFileName);
916 unlink(asecFileName);
936 unlink(asecFileName);
959 char asecFileName[255];
969 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
990 if ((fd = open(asecFileName, O_RDONLY | O_CLOEXEC)) < 0) {
1053 if (Loop::resizeImageFile(asecFileName, numImgSectors + 1)) {
1061 if (writeSuperBlock(asecFileName, &sb, numImgSectors))
1071 if (setupLoopDevice(loopDevice, sizeof(loopDevice), asecFileName, idHash, mDebug))
1076 if (setupDevMapperDevice(dmDevice, sizeof(dmDevice), loopDevice, asecFileName, key, idHash, numImgSectors, &cleanupDm, mDebug)) {
1097 Loop::resizeImageFile(asecFileName, oldNumSec);
1102 char asecFileName[255];
1112 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
1162 char asecFileName[255];
1177 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
1361 char asecFileName[255];
1370 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
1387 return unmountLoopImage(id, idHash, asecFileName, mountPoint, force);
1497 char asecFileName[255];
1506 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
1527 if (unlink(asecFileName)) {
1528 SLOGE("Failed to unlink asec '%s' (%s)", asecFileName, strerror(errno));
1629 char asecFileName[255];
1638 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
1662 if (setupLoopDevice(loopDevice, sizeof(loopDevice), asecFileName, idHash, mDebug))
1686 if (setupDevMapperDevice(dmDevice, sizeof(dmDevice), loopDevice, asecFileName, key, idHash , nr_sec, &cleanupDm, mDebug)) {