[fs] Fix code formatter nits.
Change-Id: I72ad679f70ce0d986c2b8ee07252cbee61ca2f5c
diff --git a/system/ulib/fs/BUILD.gn b/system/ulib/fs/BUILD.gn
index 3ac0bd8..57634e5 100644
--- a/system/ulib/fs/BUILD.gn
+++ b/system/ulib/fs/BUILD.gn
@@ -10,9 +10,9 @@
# Don't forget to update rules.mk as well for the Zircon build.
sources = [
"include/fs/async-dispatcher.h",
- "include/fs/connection.h",
"include/fs/block-txn.h",
"include/fs/client.h",
+ "include/fs/connection.h",
"include/fs/dispatcher.h",
"include/fs/mapped-vmo.h",
"include/fs/remote.h",
@@ -26,9 +26,9 @@
"mount.cpp",
"rpc.cpp",
"unmount.cpp",
- "watcher.cpp",
"vfs.cpp",
"vnode.cpp",
+ "watcher.cpp",
]
public_configs = [ ":fs_config" ]
diff --git a/system/ulib/fs/include/fs/vnode.h b/system/ulib/fs/include/fs/vnode.h
index aa88485..453710c 100644
--- a/system/ulib/fs/include/fs/vnode.h
+++ b/system/ulib/fs/include/fs/vnode.h
@@ -4,8 +4,8 @@
#pragma once
-#include <stdlib.h>
#include <stdint.h>
+#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@@ -23,7 +23,7 @@
#ifdef __Fuchsia__
#include <zx/channel.h>
-#endif // __Fuchsia__
+#endif // __Fuchsia__
// VFS Helpers (vfs.c)
// clang-format off
@@ -202,4 +202,4 @@
const size_t len_;
};
-}
+} // namespace fs
diff --git a/system/ulib/fs/vfs.cpp b/system/ulib/fs/vfs.cpp
index 8007101..c76afef 100644
--- a/system/ulib/fs/vfs.cpp
+++ b/system/ulib/fs/vfs.cpp
@@ -2,24 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <fbl/auto_call.h>
#include <fcntl.h>
+#include <fdio/remoteio.h>
+#include <fdio/watcher.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <fdio/remoteio.h>
-#include <fdio/watcher.h>
-#include <fbl/auto_call.h>
#ifdef __Fuchsia__
+#include <fbl/auto_lock.h>
+#include <fbl/ref_ptr.h>
+#include <fs/remote.h>
#include <threads.h>
#include <zircon/assert.h>
#include <zircon/process.h>
#include <zircon/syscalls.h>
#include <zx/event.h>
-#include <fbl/auto_lock.h>
-#include <fbl/ref_ptr.h>
-#include <fs/remote.h>
#endif
#include <fs/trace.h>
@@ -39,7 +39,7 @@
return len == 2 && strncmp(name, "..", len) == 0;
}
-#ifdef __Fuchsia__ // Only to prevent "unused function" warning
+#ifdef __Fuchsia__ // Only to prevent "unused function" warning
bool is_dot_or_dot_dot(const char* name, size_t len) {
return is_dot(name, len) || is_dot_dot(name, len);
}
@@ -93,7 +93,7 @@
}
}
-} // namespace anonymous
+} // namespace
#ifdef __Fuchsia__
@@ -101,13 +101,13 @@
return remote_.is_valid();
}
-zx::channel RemoteContainer::DetachRemote(uint32_t &flags_) {
+zx::channel RemoteContainer::DetachRemote(uint32_t& flags_) {
flags_ &= ~VFS_FLAG_MOUNT_READY;
return fbl::move(remote_);
}
// Access the remote handle if it's ready -- otherwise, return an error.
-zx_handle_t RemoteContainer::WaitForRemote(uint32_t &flags_) {
+zx_handle_t RemoteContainer::WaitForRemote(uint32_t& flags_) {
if (!remote_.is_valid()) {
// Trying to get remote on a non-remote vnode
return ZX_ERR_UNAVAILABLE;
@@ -144,7 +144,8 @@
Vfs::~Vfs() = default;
#ifdef __Fuchsia__
-Vfs::Vfs(Dispatcher* dispatcher) : dispatcher_(dispatcher) {}
+Vfs::Vfs(Dispatcher* dispatcher)
+ : dispatcher_(dispatcher) {}
#endif
zx_status_t Vfs::Open(fbl::RefPtr<Vnode> vndir, fbl::RefPtr<Vnode>* out,
@@ -347,7 +348,6 @@
return ZX_ERR_INVALID_ARGS;
}
-
if ((r = vfs_name_trim(newname, newlen, &newlen, &new_must_be_dir)) != ZX_OK) {
return r;
} else if (is_dot_or_dot_dot(newname, newlen)) {
@@ -437,7 +437,7 @@
return h;
}
-#endif // idfdef __Fuchsia__
+#endif // ifdef __Fuchsia__
zx_status_t Vfs::Ioctl(fbl::RefPtr<Vnode> vn, uint32_t op, const void* in_buf, size_t in_len,
void* out_buf, size_t out_len, size_t* out_actual) {