clang-format many files.
Test: Format-only changes; treehugger suffices.
Change-Id: I23cde3f0bbcac13bef555d13514e922c79d5ad48
diff --git a/fs/Ext4.cpp b/fs/Ext4.cpp
index 717c8b7..7ac4853 100644
--- a/fs/Ext4.cpp
+++ b/fs/Ext4.cpp
@@ -14,23 +14,20 @@
* limitations under the License.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
-#include <vector>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <string>
+#include <vector>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/types.h>
#include <sys/mman.h>
#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <sys/wait.h>
#include <linux/kdev_t.h>
@@ -59,9 +56,8 @@
static const char* kFsckPath = "/system/bin/e2fsck";
bool IsSupported() {
- return access(kMkfsPath, X_OK) == 0
- && access(kFsckPath, X_OK) == 0
- && IsFilesystemSupported("ext4");
+ return access(kMkfsPath, X_OK) == 0 && access(kFsckPath, X_OK) == 0 &&
+ IsFilesystemSupported("ext4");
}
status_t Check(const std::string& source, const std::string& target) {
@@ -74,7 +70,7 @@
int status;
int ret;
long tmpmnt_flags = MS_NOATIME | MS_NOEXEC | MS_NOSUID;
- char *tmpmnt_opts = (char*) "nomblk_io_submit,errors=remount-ro";
+ char* tmpmnt_opts = (char*)"nomblk_io_submit,errors=remount-ro";
/*
* First try to mount and unmount the filesystem. We do this because
@@ -127,8 +123,8 @@
return 0;
}
-status_t Mount(const std::string& source, const std::string& target, bool ro,
- bool remount, bool executable) {
+status_t Mount(const std::string& source, const std::string& target, bool ro, bool remount,
+ bool executable) {
int rc;
unsigned long flags;
@@ -162,8 +158,7 @@
return ForkExecvp(cmd);
}
-status_t Format(const std::string& source, unsigned long numSectors,
- const std::string& target) {
+status_t Format(const std::string& source, unsigned long numSectors, const std::string& target) {
std::vector<std::string> cmd;
cmd.push_back(kMkfsPath);
diff --git a/fs/Ext4.h b/fs/Ext4.h
index f78dc95..329f302 100644
--- a/fs/Ext4.h
+++ b/fs/Ext4.h
@@ -28,10 +28,9 @@
bool IsSupported();
status_t Check(const std::string& source, const std::string& target);
-status_t Mount(const std::string& source, const std::string& target, bool ro,
- bool remount, bool executable);
-status_t Format(const std::string& source, unsigned long numSectors,
- const std::string& target);
+status_t Mount(const std::string& source, const std::string& target, bool ro, bool remount,
+ bool executable);
+status_t Format(const std::string& source, unsigned long numSectors, const std::string& target);
status_t Resize(const std::string& source, unsigned long numSectors);
} // namespace ext4
diff --git a/fs/F2fs.cpp b/fs/F2fs.cpp
index f24fd91..9d72963 100644
--- a/fs/F2fs.cpp
+++ b/fs/F2fs.cpp
@@ -22,8 +22,8 @@
#include <android-base/stringprintf.h>
#include <ext4_utils/ext4_crypt.h>
-#include <vector>
#include <string>
+#include <vector>
#include <sys/mount.h>
@@ -37,9 +37,8 @@
static const char* kFsckPath = "/system/bin/fsck.f2fs";
bool IsSupported() {
- return access(kMkfsPath, X_OK) == 0
- && access(kFsckPath, X_OK) == 0
- && IsFilesystemSupported("f2fs");
+ return access(kMkfsPath, X_OK) == 0 && access(kFsckPath, X_OK) == 0 &&
+ IsFilesystemSupported("f2fs");
}
status_t Check(const std::string& source) {
diff --git a/fs/Vfat.cpp b/fs/Vfat.cpp
index 9873fd4..7b833d1 100644
--- a/fs/Vfat.cpp
+++ b/fs/Vfat.cpp
@@ -14,24 +14,21 @@
* limitations under the License.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/mount.h>
-#include <sys/wait.h>
#include <linux/fs.h>
#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/wait.h>
#include <linux/kdev_t.h>
@@ -41,8 +38,8 @@
#include <logwrap/logwrap.h>
-#include "Vfat.h"
#include "Utils.h"
+#include "Vfat.h"
#include "VoldUtil.h"
using android::base::StringPrintf;
@@ -55,9 +52,8 @@
static const char* kFsckPath = "/system/bin/fsck_msdos";
bool IsSupported() {
- return access(kMkfsPath, X_OK) == 0
- && access(kFsckPath, X_OK) == 0
- && IsFilesystemSupported("vfat");
+ return access(kMkfsPath, X_OK) == 0 && access(kFsckPath, X_OK) == 0 &&
+ IsFilesystemSupported("vfat");
}
status_t Check(const std::string& source) {
@@ -79,43 +75,42 @@
return -1;
}
- switch(rc) {
- case 0:
- LOG(INFO) << "Filesystem check completed OK";
- return 0;
+ switch (rc) {
+ case 0:
+ LOG(INFO) << "Filesystem check completed OK";
+ return 0;
- case 2:
- LOG(ERROR) << "Filesystem check failed (not a FAT filesystem)";
- errno = ENODATA;
- return -1;
+ case 2:
+ LOG(ERROR) << "Filesystem check failed (not a FAT filesystem)";
+ errno = ENODATA;
+ return -1;
- case 4:
- if (pass++ <= 3) {
- LOG(WARNING) << "Filesystem modified - rechecking (pass " << pass << ")";
- continue;
- }
- LOG(ERROR) << "Failing check after too many rechecks";
- errno = EIO;
- return -1;
+ case 4:
+ if (pass++ <= 3) {
+ LOG(WARNING) << "Filesystem modified - rechecking (pass " << pass << ")";
+ continue;
+ }
+ LOG(ERROR) << "Failing check after too many rechecks";
+ errno = EIO;
+ return -1;
- case 8:
- LOG(ERROR) << "Filesystem check failed (no filesystem)";
- errno = ENODATA;
- return -1;
+ case 8:
+ LOG(ERROR) << "Filesystem check failed (no filesystem)";
+ errno = ENODATA;
+ return -1;
- default:
- LOG(ERROR) << "Filesystem check failed (unknown exit code " << rc << ")";
- errno = EIO;
- return -1;
+ default:
+ LOG(ERROR) << "Filesystem check failed (unknown exit code " << rc << ")";
+ errno = EIO;
+ return -1;
}
} while (0);
return 0;
}
-status_t Mount(const std::string& source, const std::string& target, bool ro,
- bool remount, bool executable, int ownerUid, int ownerGid, int permMask,
- bool createLost) {
+status_t Mount(const std::string& source, const std::string& target, bool ro, bool remount,
+ bool executable, int ownerUid, int ownerGid, int permMask, bool createLost) {
int rc;
unsigned long flags;
@@ -128,9 +123,9 @@
flags |= (ro ? MS_RDONLY : 0);
flags |= (remount ? MS_REMOUNT : 0);
- auto mountData = android::base::StringPrintf(
- "utf8,uid=%d,gid=%d,fmask=%o,dmask=%o,shortname=mixed",
- ownerUid, ownerGid, permMask, permMask);
+ auto mountData =
+ android::base::StringPrintf("utf8,uid=%d,gid=%d,fmask=%o,dmask=%o,shortname=mixed",
+ ownerUid, ownerGid, permMask, permMask);
rc = mount(c_source, c_target, "vfat", flags, mountData.c_str());
diff --git a/fs/Vfat.h b/fs/Vfat.h
index 40be5f6..2030067 100644
--- a/fs/Vfat.h
+++ b/fs/Vfat.h
@@ -28,9 +28,8 @@
bool IsSupported();
status_t Check(const std::string& source);
-status_t Mount(const std::string& source, const std::string& target, bool ro,
- bool remount, bool executable, int ownerUid, int ownerGid, int permMask,
- bool createLost);
+status_t Mount(const std::string& source, const std::string& target, bool ro, bool remount,
+ bool executable, int ownerUid, int ownerGid, int permMask, bool createLost);
status_t Format(const std::string& source, unsigned long numSectors);
} // namespace vfat