Skip to content

Commit

Permalink
Apply clang-format 18
Browse files Browse the repository at this point in the history
Summary: Previously this code conformed from clang-format 12.

Reviewed By: igorsugak

Differential Revision: D56065247

fbshipit-source-id: f5a985dd8f8b84f2f9e1818b3719b43c5a1b05b3
  • Loading branch information
zertosh authored and facebook-github-bot committed Apr 14, 2024
1 parent 712a905 commit bfd91e4
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 52 deletions.
2 changes: 1 addition & 1 deletion eden/fs/config/InodeCatalogType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ constexpr auto inodeCatalogTypeStr = [] {
return mapping;
}();

}
} // namespace

folly::Expected<InodeCatalogType, std::string> inodeCatalogTypeFromString(
std::string_view value) {
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/config/MountProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ constexpr auto mountProtocolStr = [] {
return mapping;
}();

}
} // namespace

folly::Expected<MountProtocol, std::string>
FieldConverter<MountProtocol>::fromString(
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/config/ReaddirPrefetch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ constexpr auto readdirPrefetchStr = [] {
return mapping;
}();

}
} // namespace

folly::Expected<ReaddirPrefetch, std::string>
FieldConverter<ReaddirPrefetch>::fromString(
Expand Down
6 changes: 3 additions & 3 deletions eden/fs/fuse/FuseChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,9 @@ FuseChannel::InvalidationEntry::~InvalidationEntry() {

FuseChannel::InvalidationEntry::
InvalidationEntry(InvalidationEntry&& other) noexcept(
std::is_nothrow_move_constructible_v<PathComponent>&&
std::is_nothrow_move_constructible_v<folly::Promise<folly::Unit>>&&
std::is_nothrow_move_constructible_v<DataRange>)
std::is_nothrow_move_constructible_v<PathComponent> &&
std::is_nothrow_move_constructible_v<folly::Promise<folly::Unit>> &&
std::is_nothrow_move_constructible_v<DataRange>)
: type(other.type), inode(other.inode) {
switch (type) {
case InvalidationType::INODE:
Expand Down
6 changes: 3 additions & 3 deletions eden/fs/fuse/FuseChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,9 @@ class FuseChannel final : public FsChannel {
InvalidationEntry(InodeNumber inode, PathComponentPiece name);
explicit InvalidationEntry(folly::Promise<folly::Unit> promise);
InvalidationEntry(InvalidationEntry&& other) noexcept(
std::is_nothrow_move_constructible_v<PathComponent>&&
std::is_nothrow_move_constructible_v<folly::Promise<folly::Unit>>&&
std::is_nothrow_move_constructible_v<DataRange>);
std::is_nothrow_move_constructible_v<PathComponent> &&
std::is_nothrow_move_constructible_v<folly::Promise<folly::Unit>> &&
std::is_nothrow_move_constructible_v<DataRange>);
~InvalidationEntry();

InvalidationType type;
Expand Down
3 changes: 1 addition & 2 deletions eden/fs/inodes/InodeTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ class InodeTable {
*/
template <typename PopFn>
void populateIfNotSet(InodeNumber ino, PopFn&& populate) {
modifyOrInsert<void>(
ino, [&](auto&) {}, populate, [&](auto&) {});
modifyOrInsert<void>(ino, [&](auto&) {}, populate, [&](auto&) {});
}

/**
Expand Down
4 changes: 3 additions & 1 deletion eden/fs/inodes/RequestContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ RequestContext::~RequestContext() noexcept {
}

if (requestWatchList_) {
{ auto temp = std::move(requestMetricsScope_); }
{
auto temp = std::move(requestMetricsScope_);
}
requestWatchList_.reset();
}

Expand Down
4 changes: 1 addition & 3 deletions eden/fs/inodes/test/EdenMountTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,9 +987,7 @@ TEST(EdenMount, takeoverFuseFailsIfUnmountWasEverCalled) {
mount.unmount().within(kTimeout).get();
auto fuse = std::make_shared<FakeFuse>();
EXPECT_THROW(
{
mount.takeoverFuse(FuseChannelData{fuse->start(), {}});
},
{ mount.takeoverFuse(FuseChannelData{fuse->start(), {}}); },
EdenMountCancelled);
}

Expand Down
4 changes: 2 additions & 2 deletions eden/fs/nfs/Nfsd3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ ImmediateFuture<folly::Unit> Nfsd3ServerProcessor::lookup(
return dispatcher_
->getattr(args.what.dir.ino, context.getObjectFetchContext())
.thenValue(
[ino = args.what.dir.ino](struct stat && stat)
[ino = args.what.dir.ino](struct stat&& stat)
-> std::tuple<InodeNumber, struct stat> {
return {ino, std::move(stat)};
});
Expand All @@ -440,7 +440,7 @@ ImmediateFuture<folly::Unit> Nfsd3ServerProcessor::lookup(
return dispatcher_
->getattr(ino, context.getObjectFetchContext())
.thenValue(
[ino](struct stat && stat)
[ino](struct stat&& stat)
-> std::tuple<InodeNumber, struct stat> {
return {ino, std::move(stat)};
});
Expand Down
53 changes: 26 additions & 27 deletions eden/fs/store/FilteredBackingStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,33 +280,32 @@ FilteredBackingStore::getRootTree(
parsedRootId.value(),
filterId);
auto fut = backingStore_->getRootTree(parsedRootId, context);
return std::move(fut).thenValue([filterId_2 = std::move(filterId),
self = shared_from_this()](
GetRootTreeResult
rootTreeResult) mutable {
// Apply the filter to the root tree. The root tree is always a regular
// "unfiltered" tree.
auto filterFut = self->filterImpl(
rootTreeResult.tree,
RelativePath{""},
filterId_2,
FilteredObjectIdType::OBJECT_TYPE_TREE);
return std::move(filterFut).thenValue([self,
filterId_3 = std::move(filterId_2),
treeId = std::move(
rootTreeResult.treeId)](
std::unique_ptr<
PathMap<TreeEntry>> pathMap) {
auto rootFOID = FilteredObjectId{RelativePath{""}, filterId_3, treeId};
auto res = GetRootTreeResult{
std::make_shared<const Tree>(
std::move(*pathMap), ObjectId{rootFOID.getValue()}),
ObjectId{rootFOID.getValue()},
};
pathMap.reset();
return res;
});
});
return std::move(fut).thenValue(
[filterId_2 = std::move(filterId),
self = shared_from_this()](GetRootTreeResult rootTreeResult) mutable {
// Apply the filter to the root tree. The root tree is always a regular
// "unfiltered" tree.
auto filterFut = self->filterImpl(
rootTreeResult.tree,
RelativePath{""},
filterId_2,
FilteredObjectIdType::OBJECT_TYPE_TREE);
return std::move(filterFut).thenValue(
[self,
filterId_3 = std::move(filterId_2),
treeId = std::move(rootTreeResult.treeId)](
std::unique_ptr<PathMap<TreeEntry>> pathMap) {
auto rootFOID =
FilteredObjectId{RelativePath{""}, filterId_3, treeId};
auto res = GetRootTreeResult{
std::make_shared<const Tree>(
std::move(*pathMap), ObjectId{rootFOID.getValue()}),
ObjectId{rootFOID.getValue()},
};
pathMap.reset();
return res;
});
});
}

ImmediateFuture<std::shared_ptr<TreeEntry>>
Expand Down
4 changes: 2 additions & 2 deletions eden/fs/store/ObjectCache-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ template <typename ObjectType, ObjectCacheFlavor Flavor>
void ObjectCache<ObjectType, Flavor>::evictItem(
State& state,
const CacheItem& item) noexcept {
XLOG(DBG6) << "ObjectCache::evictItem "
<< "evicting " << item.id << " generation=" << item.generation;
XLOG(DBG6) << "ObjectCache::evictItem " << "evicting " << item.id
<< " generation=" << item.generation;
auto size = item.object->getSizeBytes();
// TODO: Releasing this ObjectPtr here can run arbitrary deleters which
// could, in theory, try to reacquire the ObjectCache's lock. The object
Expand Down
4 changes: 2 additions & 2 deletions eden/fs/store/test/TreeCacheTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ const auto tree4 = std::make_shared<const Tree>(
tree4_id);

const auto entrySize = sizeof(entry0);
const auto smallTreeSize = tree0 -> getSizeBytes();
const auto bigTreeSize = tree4 -> getSizeBytes();
const auto smallTreeSize = tree0->getSizeBytes();
const auto bigTreeSize = tree4->getSizeBytes();
const auto cacheMaxSize = smallTreeSize * 3 + 1; // cache fits 3 small trees
const auto cacheMinEntries = 1; // must keep at least one tree in cache

Expand Down
4 changes: 2 additions & 2 deletions eden/scm/lib/backingstore/src/SaplingNativeBackingStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ SaplingNativeBackingStore::getBlobMetadata(NodeId node, bool local) {
if (local) {
fetch_mode = FetchMode::LocalOnly;
}
XLOG(DBG7) << "Importing blob metadata"
<< " node=" << folly::hexlify(node) << " from hgcache";
XLOG(DBG7) << "Importing blob metadata" << " node=" << folly::hexlify(node)
<< " from hgcache";
return folly::makeTryWith([&] {
auto metadata = sapling_backingstore_get_file_aux(
*store_.get(),
Expand Down
4 changes: 2 additions & 2 deletions eden/scm/sapling/cext/osutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ static int to_python_time(const FILETIME* tm) {
/* conversion factor from 100ns to 1s */
const __int64 a1 = 10000000;
/* explicit (int) cast to suspend compiler warnings */
return (
int)((((__int64)tm->dwHighDateTime << 32) + tm->dwLowDateTime) / a1 - a0);
return (int)((((__int64)tm->dwHighDateTime << 32) + tm->dwLowDateTime) / a1 -
a0);
}

#ifdef IS_PY3K
Expand Down

0 comments on commit bfd91e4

Please sign in to comment.